Correct pwsh run (#11486)

This commit is contained in:
Ilya
2020-01-05 12:17:41 +05:00
committed by GitHub
parent 2c0d68c1c2
commit b221c2afa2
22 changed files with 61 additions and 56 deletions
@@ -1,7 +1,9 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
Describe "Native streams behavior with PowerShell" -Tags 'CI' {
$powershell = Join-Path -Path $PsHome -ChildPath "pwsh"
BeforeAll {
$powershell = Join-Path -Path $PsHome -ChildPath "pwsh"
}
Context "Error stream" {
# we are using powershell itself as an example of a native program.
@@ -57,7 +59,7 @@ Describe "Native streams behavior with PowerShell" -Tags 'CI' {
while ($longtext.Length -lt [console]::WindowWidth) {
$longtext += $longtext
}
pwsh -c "& { [Console]::Error.WriteLine('$longtext') }" 2>&1 > $testdrive\error.txt
& $powershell -c "& { [Console]::Error.WriteLine('$longtext') }" 2>&1 > $testdrive\error.txt
$e = Get-Content -Path $testdrive\error.txt
$e.Count | Should -Be 1
$e | Should -BeExactly $longtext