September 1st, 2013

PowerTip: Display Progress Bar with PowerShell

Doctor Scripto
Scripter

Summary: Learn how to display a progress bar by using Windows PowerShell.

Hey, Scripting Guy! Question How can I easily display a progress bar by using Windows PowerShell?

Hey, Scripting Guy! Answer Use the Write-Progress cmdlet:

for ($i = 1; $i -le 100; $i++) {Write-Progress -Activity ‘counting’ -Status “

$i percent” -PercentComplete $i ; sleep -Milliseconds 20}

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.