Skip to content

Instantly share code, notes, and snippets.

@techthoughts2
Last active August 24, 2018 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techthoughts2/5ad7cffb6f80743bfc5c1ed0fa7a1625 to your computer and use it in GitHub Desktop.
Save techthoughts2/5ad7cffb6f80743bfc5c1ed0fa7a1625 to your computer and use it in GitHub Desktop.
Progress Bar
Write-Progress -Activity "Test" -PercentComplete 25
Start-Sleep(5)
Write-Progress -Activity "Test" -PercentComplete 50
Start-Sleep(5)
Write-Progress -Activity "Test" -PercentComplete 75
Start-Sleep(5)
Write-Progress -Activity "Test" -PercentComplete 100
#secind example of progress bar
$seconds = 60
1..$seconds |
ForEach-Object { $percent = $_ * 100 / $seconds;
Write-Progress -Activity Break -Status "$($seconds - $_) seconds remaining..." -PercentComplete $percent;
Start-Sleep -Seconds 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment