Closed pauby closed 5 years ago
Thanks for reporting this @pauby. I see the reason this is happening. The value of $PSBPreference.Build.ModuleOutDir
is based on the value of $PSBPreference.Build.OutDir
and is set in the build.properties.ps1 which is called when the psakeFile in PowerShellBuild
is run, not when your psakeFile is run. You would think to override $PSBPreference.Build.OutDir
to set the output directory and that technically is correct but by the time your psakeFile is executed, $PSBPreference.Build.ModuleOutDir
already has its value so unless you set that directly, it will keep the original value.
To make it simpler, I think we should just drop $PSBPreference.Build.ModuleOutDir
from being a public value and just keep $PSBPreference.Build.OutDir
. We can compute the full path to the module internally. This way, setting $PSBPreference.Build.OutDir
in your psakeFile will behave as expected.
@pauby This is fixed in 11e1b94f22b295cfa7a6494bc7d0c25e2fb52864 and will be a part of v0.5.0
if you want to give that a go.
tl:dr; $PSBPreference.Build.ModuleOutDir
is now set internally during Initialize-PSBuild
. Users should only need to set $PSBPreference.Build.OutDir
and it will accept relative or full paths to the desired output directory.
Expected Behavior
When setting $PSBPreference.Build.OutDir I expect the Output Directory specified to be used but it is not.
Current Behavior
Instead of the value of $PSBPreference.Build.OutDir being used as the Output Directory, "$projectRoot/Output" is used.
Possible Solution
The problem is two fold:
There needs to be an agreement on which of the above is correct - the docs or the code. Once that's known we can change the other one.