mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Fixing Start-PSPester for non-Windows environments.
This commit is contained in:
1 parent
5676a44f38
commit
a7f5d28f5f
1 file changed
+6
-1
+6
-1
@@ -539,7 +539,12 @@ function Start-PSPester {
|
||||
|
||||
Write-Verbose "Import-Module '$moduleDir'; Invoke-Pester $tagString $Path"
|
||||
$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) {
|
||||
throw "$LASTEXITCODE Pester tests failed"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user