Changing Error Background Color

by Jun 4, 2010

If you would like to make error messages more readable, you can change their background color from black to white:

$host.PrivateData.ErrorBackgroundColor = ‘White’

Use this line to see the colors that you can assign:

[System.Enum]::GetNames([System.ConsoleColor])

To use a transparent error background color, you should assign the current console background color:

$host.PrivateData.ErrorBackgroundColor = $host.UI.RawUI.BackgroundColor

Twitter This Tip!
ReTweet this Tip!