June 23rd, 2016

PowerTip: Set the color of the progress bar with PowerShell

Doctor Scripto
Scripter

Summary: Use the $Host object to alter the color of the progress bar in PowerShell.

Hey, Scripting Guy! Question I was curious if there’s a way to change the color of the progress bar in PowerShell. Do you know how this could be done?

Hey, Scripting Guy! Answer Glad you asked! You can do this by altering the values for ProgressBackGroundColor and ProgressForegroundColor under $Host.PrivateData.

To change to a bright green background with a black foreground, use the following code in PowerShell:

$Host.PrivateData.ProgressBackgroundColor=’Green’ $Host.PrivateData.ProgressForegroundColor=’Black’

The Doctor

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.