Prerequisites
Steps to reproduce
On PowerShell with conhost use the following Command:
dotnet --version | Write-Verbose -Verbose
If dotnet is not installed you can also use cmd /c ver or any other programm.
Expected behavior
Printing the following output in yellow:
Actual behavior
The following Text is printed colorless:
�[33;1mVERBOSE: 7.0.100�[0m
Error details
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:
←[31;1mWrite-Verbose: ←[31;1mA parameter cannot be found that matches parameter name 'u'.←[0m
But after this the previous example works as expected (See image below).
When the text is not streamed for example when intercepting the output with out-string (without the -Stream parameter) it also works.
I already had an issue for this in #18771 wich got blamed on the terminal repo and closed without any investigation. In my opinion this must be an issue with powershell because:
- It worked in older 7.2.x versions
- It randomly works after a runtime error
- The terminal guy thinks so aswell
We provide powershell commands with our program and it really sucks to explain to every customer that we can't fix this and that they have to install an older version or another terminal to fix this.
Also some other items that seem related:
#16612
#18294
#19425
### Environment data
```powershell
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
Also tested with 7.3.4 and 7.4.0-preview.3
Visuals

Prerequisites
Steps to reproduce
On PowerShell with conhost use the following Command:
If dotnet is not installed you can also use
cmd /c veror any other programm.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
For some very odd reason after I type an incorrect parameter like this:
dotnet --version | Write-Verbose -u # -u does not existThe error-message is again displayed with ansi escape signs:
←[31;1mWrite-Verbose: ←[31;1mA parameter cannot be found that matches parameter name 'u'.←[0mBut after this the previous example works as expected (See image below).
When the text is not streamed for example when intercepting the output with out-string (without the -Stream parameter) it also works.
I already had an issue for this in #18771 wich got blamed on the terminal repo and closed without any investigation. In my opinion this must be an issue with powershell because:
We provide powershell commands with our program and it really sucks to explain to every customer that we can't fix this and that they have to install an older version or another terminal to fix this.
Also some other items that seem related:
#16612
#18294
#19425
Visuals