October 3rd, 2014

PowerTip: Change Color of PowerShell Errors

Doctor Scripto
Scripter

Summary: Learn how to change the color of Windows PowerShell errors.

Hey, Scripting Guy! Question How can I change the color of Windows PowerShell errors in the Windows PowerShell console?

Hey, Scripting Guy! Answer Use $host.PrivateData and supply a new value for ErrorForegroundColor, for example:

$Host.PrivateData.ErrorForegroundColor = 'white'

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback