Closed michaeltlombardi closed 7 years ago
It looks like this might actually be related to PowerShell/PlatyPS#218
I am able to execute manually in the commandline without issues, but getting it to work in the build seems tricky. Investigating.
It looks like it's necessary to import the module into the global scope; doing so fixes the build for reasons I don't (yet) understand.
task CreateMarkdownHelp -Depends Init {
Import-Module -Name $sut -Force -Verbose:$false
New-MarkdownHelp -Module $env:BHProjectName -OutputFolder "$projectRoot\docs\reference\functions" -WithModulePage -Force
} -description 'Create initial markdown help files'
task CreateMarkdownHelp -Depends Init {
Import-Module -Name $sut -Force -Verbose:$false -Global
New-MarkdownHelp -Module $env:BHProjectName -OutputFolder "$projectRoot\docs\reference\functions" -WithModulePage -Force
Remove-Module $env:BHProjectName
} -description 'Create initial markdown help files'
When running psake as administrator to create markdown help files, the build script errors out because it never imports the PoshBot module.
Expected Behavior
When running the
CreateMarkdownHelp
task via the build script, it should automatically import the version of PoshBot available in the project root and export the function comment-based help.Current Behavior
The build script errors out.
Possible Solution
Ensure that the module is properly loaded in a prior step or load and unload in this task itself.
Steps to Reproduce (for bugs)
.\build.ps1 -Task CreateMarkdownHelp
Screenshot
Context
Users should be able to run the build tasks without errors, even if only performing one task.
Your Environment
0.1.0
10.0.14393
, PowerShell5.1.14393.953
0.0.29
4.6.0
0.7.6
4.0.3
1.11.0