Created
August 30, 2013 22:39
-
-
Save jmoberly/6394984 to your computer and use it in GitHub Desktop.
How to have a cool progress bar in Powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$thingsArray = 0,1,2,3,4,5,6,7,8,9 | |
$i = 0 | |
foreach($thing in $thingsArray) | |
{ | |
Start-Sleep -s 1 | |
$i++ | |
$complete = $i / $thingsArray.Length * 100 | |
Write-Progress -activity "Retrieving things..." -status "Percent found: " -PercentComplete $complete | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment