Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompileModule = $true fails on Classes #66

Open
TrisBits opened this issue Dec 15, 2022 · 1 comment
Open

CompileModule = $true fails on Classes #66

TrisBits opened this issue Dec 15, 2022 · 1 comment

Comments

@TrisBits
Copy link

When executing a build using $PSBPreference.Build.CompileModule = $true on a base Stucco template, I receive an error on the Task GENERATEMARKDOWN. However, if I use $PSBPreference.Build.CompileModule = $false the build will succeed.

Expected Behavior

The build of a monolithic PSM1 should not produce errors regarding Classes.

Current Behavior

I receive the following error:

Error: 2022-12-14 9:19:54 PM:
At C:\Temp\ModuleNew\Output\ModuleNew\0.1.0\ModuleNew.psm1:31 char:14 + … classes = @(Get-ChildItem -Path (Join-Path -Path $PSScriptRoot -Child … + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [<<==>>] Exception: Cannot find path 'C:\Temp\ModuleNew\Output\ModuleNew\0.1.0\Classes' because it does not exist.

Steps to Reproduce (for bugs)

  1. Create a new module with Stucco
  2. Set psakeFile parameter $PSBPreference.Build.CompileModule = $true
  3. Execute .\build.ps1 from a pwsh terminal

Context

This issue prevents me from being able to build a module.

Your Environment

  • Module version used: 0.6.1
  • Operating System and PowerShell version: Windows 10 22H2 , PowerShell 7.2.7
@HeyItsGilbert
Copy link
Member

It sounds like your C:\Temp\ModuleNew\ModuleNew\ModuleNew.psm1 has code that is loading from that directory. If you're compiling you'll want to edit your psm1 file to account for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants