Skip to content

Commit

Permalink
Adding new PSModulePath var to ScriptBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
Agazoth committed Jul 22, 2024
1 parent f2d0f48 commit 7060f0c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions PSParquet.psake.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,15 @@ Task ResetPSModulePath {
Task UpdateHelp -depends InitializeModuleFile {
"Updating help for module: $ModuleName"
$ScriptBlock = {
$psm1File, $DevModuleFolder, $Modulename = $args
"Setting up PSModulePath"
$psm1File, $DevModuleFolder, $Modulename, $OutputModule = $args
$p = [Environment]::GetEnvironmentVariable("PSModulePath")
$parts = $p -split ';'
$parts += $OutputModule
[Environment]::SetEnvironmentVariable("PSModulePath", $($parts -join ';'))
$Docs = Join-Path $DevModuleFolder 'docs'
$EnUs = Join-Path $DevModuleFolder 'en-US'
Import-Module $psm1File -Force -Global
Import-Module $ModuleName -Force
if (!$(Test-Path $Docs)) {
New-MarkdownHelp -WithModulePage -Module $Modulename -OutputFolder $Docs
}
Expand All @@ -127,7 +132,7 @@ Task UpdateHelp -depends InitializeModuleFile {
}
New-ExternalHelp $Docs -OutputPath $EnUs -Force
}
Start-Job -ScriptBlock $ScriptBlock -ArgumentList $Script:psm1, $Script:DevModuleFolder, $Script:ModuleName | Wait-Job | Receive-Job
Start-Job -ScriptBlock $ScriptBlock -ArgumentList $Script:psm1, $Script:DevModuleFolder, $Script:ModuleName, $Script:OutputFolder | Wait-Job | Receive-Job
Get-Job | Remove-Job

}
Expand Down

0 comments on commit 7060f0c

Please sign in to comment.