From 19e1cc450b1fad9c530c50960a47aa861c3995fd Mon Sep 17 00:00:00 2001 From: James Truher Date: Tue, 26 Jul 2016 14:37:15 -0700 Subject: [PATCH] final changes for start-pspester --- build.psm1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.psm1 b/build.psm1 index de00900347..8ee2c39fd7 100644 --- a/build.psm1 +++ b/build.psm1 @@ -476,7 +476,7 @@ function Start-PSPester { ) $tagString = "-outputFormat ${OutputFormat} -outputFile ${outputFile} " if ( ! $DisableExit ) { $tagString += " -EnableExit" } - if ( $ExcludeTag ) { $tagString += " -ExcludeTag @('" + (${ExcludeTag} -join "','") + "')" } + if ( $ExcludeTag -and ($ExcludeTag -ne "")) { $tagString += " -ExcludeTag @('" + (${ExcludeTag} -join "','") + "')" } if ( $Tag ) { $tagString += " -Tag @('" + (${Tag} -join "','") + "')" } $powershell = get-psoutput @@ -484,7 +484,8 @@ function Start-PSPester { $moduleDir = [io.path]::Combine($psdir,"Modules","Pester") Write-Verbose "Import-Module '$moduleDir'; Invoke-Pester $tagString $Path" - & (Get-PSOutput) -noprofile -c "Import-Module '$moduleDir'; Invoke-Pester $tagString $Path" + $powershellexe = get-psoutput + & $powershell -noprofile -c "Import-Module '$moduleDir'; Invoke-Pester $tagString $Path" if ($LASTEXITCODE -ne 0) { throw "$LASTEXITCODE Pester tests failed" }