PowerTip: Set the color of the progress bar with PowerShell


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

Comments (0)

Skip to main content