Skip to content

Write-Warning style is not reset when PSAnsiRendering is enabled #14480

@hazychill

Description

@hazychill

Steps to reproduce

Enable-ExperimentalFeature PSAnsiRendering

Then, restart PowerShell.

Write-Warning 'xxx'

Expected behavior

With PSAnsiRendering disabled, output yellow text only for warning message (xxx), not for prompt.

image

Actual behavior

With PSAnsiRendering enabled, output yellow text for warning message (xxx), and all the following output.

Write-Error resets the style.

image

Environment data

PS D:\tools\PowerShell-7.2.0-preview.2-win-x64> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.2.0-preview.2
PSEdition                      Core
GitCommitId                    7.2.0-preview.2
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

Labels

Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aWG-Interactive-Consolethe console experience

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions