-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
On PowerShell with conhost use the following Command:
dotnet --version | Write-Verbose -VerboseIf dotnet is not installed you can also use cmd /c ver or 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:
- 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
