diff --git a/pester-extensions.psm1 b/pester-extensions.psm1 index 8a5953d..242fe08 100644 --- a/pester-extensions.psm1 +++ b/pester-extensions.psm1 @@ -12,7 +12,9 @@ function Get-CommandResult { [switch] $Multiline ) # CMD trick to suppress and show error output because some commands write to stderr (for example, "python --version") - [string[]]$output = & $env:comspec /c "$Command 2>&1" + if ($IsWindows) { + [string[]]$output = & $env:comspec /c "$Command 2>&1" + } $exitCode = $LASTEXITCODE return @{