pull/15/head
Nikita Bykov 5 years ago
parent 00ba6e7266
commit 193f37b2fa

@ -7,9 +7,7 @@ Pester extension that allows to run command and validate exit code
function Get-CommandResult { function Get-CommandResult {
Param ( Param (
[Parameter(Mandatory)] [Parameter(Mandatory)][string] $Command
[string] $Command,
[switch] $Multiline
) )
# CMD trick to suppress and show error output because some commands write to stderr (for example, "python --version") # CMD trick to suppress and show error output because some commands write to stderr (for example, "python --version")
if ($IsWindows) { if ($IsWindows) {
@ -20,7 +18,7 @@ function Get-CommandResult {
$exitCode = $LASTEXITCODE $exitCode = $LASTEXITCODE
return @{ return @{
Output = If ($Multiline -eq $true) { $output } else { [string]$output } Output = $output
ExitCode = $exitCode ExitCode = $exitCode
} }
} }

Loading…
Cancel
Save