Changing Console Colors

Like any other console window, PowerShell has 16 pre-defined colors that you can choose from to set background and foreground color. You can use two different approaches to set the values. Both set the console background color to "Blue":

$host.UI.RawUI.BackgroundColor = 'Blue'
[System.Console]::BackgroundColor = 'Blue'

You can enter Clear-Host to have the entire console background repainted.

Twitter This Tip! ReTweet this Tip!


Posted Oct 19 2010, 08:00 AM by ps1
Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.