Skip to content

Instantly share code, notes, and snippets.

@michaelvdnest
Created November 20, 2019 13:49
Show Gist options
  • Save michaelvdnest/dabb80b00d65f09beca1cfc769dd52c3 to your computer and use it in GitHub Desktop.
Save michaelvdnest/dabb80b00d65f09beca1cfc769dd52c3 to your computer and use it in GitHub Desktop.
An example of multiple progress bars in Powershell
For ($i=0; $i -le 10; $i++) {
Start-Sleep -Milliseconds 1
Write-Progress -Id 1 -Activity "First Write Progress" -Status "Current Count: $i" -PercentComplete (($i/10)*100) -CurrentOperation "Counting ..."
For ($j=0; $j -le 10; $j++) {
Start-Sleep -Milliseconds 1
Write-Progress -Id 2 -Activity "Second Write Progress" -Status "Current Count: $j" -PercentComplete (($j/10)*100) -CurrentOperation "Counting ..."
For ($k=0; $k -le 20; $k++) {
Start-Sleep -Milliseconds 1
Write-Progress -Id 3 -Activity "Third Write Progress" -Status "Current Count: $k" -PercentComplete (($k/20)*100) -CurrentOperation "Counting ..."
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment