-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Resolution-AnsweredThe question is answered.The question is answered.WG-Interactive-Consolethe console experiencethe console experience
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
First off this issue doesn't appear if running the script from a terminal in VSCode
But I am launching PS scripts from Java and passing values for both PSStyle.OutputRendering & NO_COLOR and I'm able to see that the values are there if I output them during execution.
But the following, which here throws an exception since the store doesn't exist, will produce some Ansi code:
Get-SecretVault -Name xxStore | ConvertTo-Json
Finally found this issue and decided to also set the __SuppressAnsiEscapeSequences and everything started to work correctly. I would have expected that the other variants would have set that variable, but again showing during execution, it wasn't set, unless I passed the value manually.
Expected behavior
Get-SecretVault: C:\Users\XXXX\AppData\Local\Temp\psscript_167700463450917082999875903795167.ps1:15
Line |
15 | Get-SecretVault -Name xxStore | ConvertTo-Json
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Vault xxStore does not exist in registry.Actual behavior
�[31;1mGet-SecretVault: �[0mC:\Users\XXXXX\AppData\Local\Temp\psscript_16770047511711965109290211120660.ps1:15�[0m
�[31;1m�[0m�[36;1mLine |�[0m
�[31;1m�[0m�[36;1m�[36;1m 15 | �[0m �[36;1mGet-SecretVault -Name xxStore�[0m | ConvertTo-Json�[0m
�[31;1m�[0m�[36;1m�[36;1m�[0m�[36;1m�[0m�[36;1m | �[31;1m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~�[0m
�[31;1m�[0m�[36;1m�[36;1m�[0m�[36;1m�[0m�[36;1m�[31;1m�[31;1m�[36;1m | �[31;1mVault xxStore does not exist in registry.�[0mError details
No response
Environment data
Name Value
---- -----
PSVersion 7.3.2
PSEdition Core
GitCommitId 7.3.2
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.0Visuals
No response
Metadata
Metadata
Assignees
Labels
Resolution-AnsweredThe question is answered.The question is answered.WG-Interactive-Consolethe console experiencethe console experience