Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to change the colors outputed by Write-* for -Warning, -Debug, -Error and -Verbose #565

Closed
AdamNaj opened this issue Jan 14, 2016 · 2 comments
Assignees
Milestone

Comments

@AdamNaj
Copy link
Member

AdamNaj commented Jan 14, 2016

Basically this functionality should work as in Windows PowerShell, so this code should produce results WPS behaviour:

$Host.UI.RawUI.BackgroundColor = ($bckgrnd = 'DarkRed')
$Host.UI.RawUI.ForegroundColor = 'Cyan'
$Host.PrivateData.ErrorForegroundColor = 'Red'
$Host.PrivateData.ErrorBackgroundColor = $bckgrnd
$Host.PrivateData.WarningForegroundColor = 'Magenta'
$Host.PrivateData.WarningBackgroundColor = $bckgrnd
$Host.PrivateData.DebugForegroundColor = 'Yellow'
$Host.PrivateData.DebugBackgroundColor = $bckgrnd
$Host.PrivateData.VerboseForegroundColor = 'Green'
$Host.PrivateData.VerboseBackgroundColor = $bckgrnd
$Host.PrivateData.ProgressForegroundColor = 'Cyan'
$Host.PrivateData.ProgressBackgroundColor = $bckgrnd
Write-Host    "                    Write-Host                  "
Write-Verbose "                    Write-Verbose               " -Verbose
Write-Error   "                    Write-Error                 "
Write-Warning "                    Write-Warning                 "

However since we are running in a HTML styled scenario this can even be improved and we can retrofit the colors for already typed regular Write-Host text.

image

@AdamNaj AdamNaj added this to the 4.0 milestone Jan 14, 2016
@AdamNaj AdamNaj self-assigned this Jan 14, 2016
AdamNaj added a commit that referenced this issue Jan 14, 2016
@AdamNaj
Copy link
Member Author

AdamNaj commented Jan 14, 2016

Implemented

@AdamNaj AdamNaj closed this as completed Jan 14, 2016
@michaellwest
Copy link
Member

Nice!

AdamNaj added a commit that referenced this issue Jan 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants