Is it possible to change Write-Progress color scheme and other UI things, like progress bar?
Presently, its light green with a progress bar composed of "O"... And I want to change the color (or remove the color) and replace that "O" with something else.
You can use the Write-Progress cmdlet to add a progress bar to any PowerShell script. Microsoft has provided a super simple script to show how this cmdlet works. The first line of the script sets up a loop. The loop starts with the $i variable set to 1 and each loop cycle increases the value of $i by 1 ($i++).
The Write-Verbose cmdlet writes text to the verbose message stream in PowerShell. Typically, the verbose message stream is used to deliver more in depth information about command processing.
The Do-While loop is a looping structure in which a condition is evaluated after executing the statements. This loop is also known as the exit-controlled loop. The do-while loop is the same as while loop, but the condition in a do-while loop is always checked after the execution of statements in a block.
You can change the foreground and background colors of the Write-Progress
output by modifying the ProgressForegroundColor
and ProgressBackgroundColor
of the $host.privatedata
ConsoleColorProxy
object.
For example, if you really hate your eyes:
$host.privatedata.ProgressForegroundColor = "darkgreen";
$host.privatedata.ProgressBackgroundColor = "red";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With