Color Week: Changing Error Message Colors in the PowerShell ISE

by Sep 19, 2016

This week we are looking at how you can change coloring both in the PowerShell console and PowerShell ISE so you can fine tune your PowerShell environment.

In the previous tip we explained how you can change colors for PowerShell’s predefined colors, like error message colors.

In the PowerShell ISE, you can specify these colors using the limited 16 console colors:

 
$host.PrivateData.ErrorBackgroundColor="White"
$host.PrivateData.ErrorForegroundColor=
 

However, the PowerShell ISE also accepts self-defined and WPF colors. This would output error messages with orange text on a transparent background:

 
$host.PrivateData.ErrorBackgroundColor="#00000000"
$host.PrivateData.ErrorForegroundColor=[System.Windows.Media.Colors]::OrangeRed
 

Twitter This Tip! ReTweet this tip