Merge pull request #1655 from PowerShell/mirichmo/fixing-start-pspester
Fixing Start-PSPester for non-Windows environments. Fixes regression caused by PR #1530
This commit is contained in:
commit
a01436477e
1 changed files with 6 additions and 1 deletions
|
@ -539,7 +539,12 @@ function Start-PSPester {
|
||||||
|
|
||||||
Write-Verbose "Import-Module '$moduleDir'; Invoke-Pester $tagString $Path"
|
Write-Verbose "Import-Module '$moduleDir'; Invoke-Pester $tagString $Path"
|
||||||
$powershellexe = get-psoutput
|
$powershellexe = get-psoutput
|
||||||
& $powershell -noprofile -c "Set-ExecutionPolicy -Scope Process Unrestricted; Import-Module '$moduleDir'; Invoke-Pester $tagString $Path"
|
$execPolicy = ""
|
||||||
|
if ($IsWindows)
|
||||||
|
{
|
||||||
|
$execPolicy = "Set-ExecutionPolicy -Scope Process Unrestricted; "
|
||||||
|
}
|
||||||
|
& $powershell -noprofile -c "$execPolicy Import-Module '$moduleDir'; Invoke-Pester $tagString $Path"
|
||||||
if ($LASTEXITCODE -ne 0) {
|
if ($LASTEXITCODE -ne 0) {
|
||||||
throw "$LASTEXITCODE Pester tests failed"
|
throw "$LASTEXITCODE Pester tests failed"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue