Beta 42

Research and Development

Menu

PowerShell - Resetting Console Colors

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.