Resetting Console Colors in Powershell

by Oct 22, 2012

If a console application or script has changed the console colors and you want to reset them to the default colors defined in your console properties, try this:

PS> $host.ui.RawUI.ForegroundColor = 'Red'

Now, the foreground color is red. Revert it back to standards:

PS> [Console]::ResetColor()

Note that this will work in a real console only. It does not work in the ISE Console pane.

Twitter This Tip! ReTweet this Tip!