mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Fix native executables not redirecting to file (#19842)
This commit is contained in:
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
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user