From d1fb7f9772ec1a4fafb39c75a52ef064b6467398 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 14 Oct 2016 14:17:13 +0200 Subject: Windows Build Flow: Fixed error of premature module unload. --- dist/mcode/windows/shared.psm1 | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'dist/mcode/windows/shared.psm1') diff --git a/dist/mcode/windows/shared.psm1 b/dist/mcode/windows/shared.psm1 index e39ce67ce..81a11be82 100644 --- a/dist/mcode/windows/shared.psm1 +++ b/dist/mcode/windows/shared.psm1 @@ -32,19 +32,19 @@ [CmdletBinding()] param( - [Parameter(Mandatory=$true)][string]$WorkingDir + [Parameter(Mandatory=$true)][string]$WorkingDir, + [Parameter(Mandatory=$true)][Switch]$Hosted ) -$Module_WorkingDir = $WorkingDir +$Module_WorkingDir = $WorkingDir +$Module_Hosted = $Hosted function Exit-CompileScript -{ <# +{ <# .SYNOPSIS Undocumented - .DESCRIPTION Undocumented - .PARAMETER ExitCode ExitCode of this script run #> @@ -52,13 +52,12 @@ function Exit-CompileScript param( [int]$ExitCode = 0 ) - cd $Module_WorkingDir - # unload modules - Remove-Module shared -Verbose:$false - Remove-Module targets -Verbose:$false - + if (-not $Module_Hosted) + { Remove-Module shared -Verbose:$false + Remove-Module targets -Verbose:$false + } exit $ExitCode } -- cgit v1.2.3