mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Correct pwsh run (#11486)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user