diff --git a/test/powershell/Host/ConsoleHost.Tests.ps1 b/test/powershell/Host/ConsoleHost.Tests.ps1 index e821df9b457..0ca8978353d 100644 --- a/test/powershell/Host/ConsoleHost.Tests.ps1 +++ b/test/powershell/Host/ConsoleHost.Tests.ps1 @@ -174,7 +174,7 @@ Describe "ConsoleHost unit tests" -tags "Feature" { It "-File should fail for script without .ps1 extension" -Skip:(!$IsWindows) { $Filename = 'test.xxx' Set-Content -Path $testdrive/$Filename -Value "'hello'" - & $powershell -NoProfile -File $testdrive/$Filename > $null + & $powershell -NoProfile -File $testdrive/$Filename 2>&1 $null $LASTEXITCODE | Should -Be 64 }