From 4a07aaf854948276cb4254b6cac9e0fedbc4142e Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Mon, 7 Sep 2020 15:39:25 +0300 Subject: [PATCH] fix --- pester-extensions.psm1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 @{