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
When piping input of an application to an Commandlet like Write-Error the written content contains the ansi escaping signs.
For example the command:
dotnet --version |Write-Verbose-Verbose
Expected behavior
Printing the following output in yellow:
VERBOSE: 7.0.100
Actual behavior
The following Text is printed colorless:
�[33;1mVERBOSE: 7.0.100�[0m
Error details
If the output is intercepted with Out-String the output seems to work correctly unless the Parameter -Stream is used. Seems like the Encoding is only broken when the text is returned as a stream down the pipline instead of at the end of the command.
For some very odd reason after I type an incorrect parameter like this:
dotnet --version |Write-Verbose-u # -u does not exist
The error-message is again displayed with ansi escape signs, but afterwards everything works as expected when I use the previous command again.
Environment data
Name Value
---------
PSVersion 7.3.0
PSEdition Core
GitCommitId 7.3.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
When piping input of an application to an Commandlet like Write-Error the written content contains the ansi escaping signs.
For example the command:
Expected behavior
Printing the following output in yellow:
VERBOSE: 7.0.100Actual behavior
The following Text is printed colorless:
�[33;1mVERBOSE: 7.0.100�[0mError details
If the output is intercepted with Out-String the output seems to work correctly unless the Parameter -Stream is used. Seems like the Encoding is only broken when the text is returned as a stream down the pipline instead of at the end of the command.
For some very odd reason after I type an incorrect parameter like this:
The error-message is again displayed with ansi escape signs, but afterwards everything works as expected when I use the previous command again.
Environment data
Visuals