Skip to content

Instantly share code, notes, and snippets.

@jmoberly
Created August 30, 2013 22:39
Show Gist options
  • Save jmoberly/6394984 to your computer and use it in GitHub Desktop.
Save jmoberly/6394984 to your computer and use it in GitHub Desktop.
How to have a cool progress bar in Powershell
$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