Fix native executables not redirecting to file (#19842)

This commit is contained in:
Patrick Meinecke authored and GitHub committed 2023-06-23 12:16:18 -07:00
1 parent 04f503a3b7
commit 066d7bff2c
2 files changed
+24 -4

No files matched your search

@@ -63,4 +63,18 @@ Describe 'Native command byte piping tests' -Tags 'CI' {
($pipe)?.Dispose()
}
}
It 'Bytes are retained when redirecting to a file' {
testexe -writebytes FF > $TestDrive/content.bin | Should -BeNullOrEmpty
Get-Content -LiteralPath $TestDrive/content.bin -AsByteStream | Should -Be 0xFFuy
}
It 'Bytes are retained when redirecting to a file and Out-Default is downstream' {
testexe -writebytes FF > $TestDrive/content2.bin | Out-Default
Get-Content -LiteralPath $TestDrive/content2.bin -AsByteStream | Should -Be 0xFFuy
}
It 'Redirecting to $null should emit no output' {
testexe -writebytes FF > $null | Should -BeNullOrEmpty
}
}