Closed PshMike closed 5 years ago
Hi @mjenne, thanks for reporting this.
This is intended behavior. It is expected that if you wish to compile the module, that you'll need to comment out/remove any logic in your PSM1 that is dot sourcing the public/private functions. We're still copying the PSM1 because it is common to have initialization logic in the PSM1 and the way it's currently designed, you wouldn't have a place to define that without copying the existing PSM1.
I think a better option is to model what ModuleBuild does, and add support for prefix/suffix strings or file paths. These would be added to a (newly built) PSM1 before and after public and private functions. This should add extra flexibility so people can structure the compiled PSM1 the way they need.
PR #28 introduced a fix for this.
Using option to CompileModule results in original PSM1 file having *.ps1 files appended.
Expected Behavior
new PSM1 file should have code from all *.ps1 files, and nothing else.
Current Behavior
original PSM1 file is copied (which includes code to dot-source .ps1 files ) AND the contents of .ps1 files is appended to the original PSM1 file
Possible Solution
When using CompileModule flag the original PSM1 file should NOT be copied to OUTPUT directory
Steps to Reproduce (for bugs)
Context
Resulting PSM1 file is incorrect.
Your Environment