You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran across this by accident while trying to workaround issue #20747.
If I'm using PowerShell 7.4.0 and I invoke pwsh with -Command and I redirect the output of pwsh to a file, that file ends up containing CLIXML with an encoded version of the output rather than the actual output, as happens in 7.3.10
When doing this with a script and pwsh -File things work as expected.
Name Value
---------
PSVersion 7.4.0
PSEdition Core
GitCommitId 7.4.0
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Prerequisites
Steps to reproduce
I ran across this by accident while trying to workaround issue #20747.
If I'm using PowerShell 7.4.0 and I invoke
pwshwith-Commandand I redirect the output ofpwshto a file, that file ends up containing CLIXML with an encoded version of the output rather than the actual output, as happens in 7.3.10When doing this with a script and
pwsh -Filethings work as expected.This appears to be related to the PR: Support byte stream piping between native commands and file redirection by @SeeminglyScience that was added in preview 4.
Expected behavior
Actual behavior
Error details
No error invovled.Environment data
Visuals
7.3.10
7.4.0