Created
November 13, 2021 11:52
-
-
Save chrdek/3f8aac12abed7903e8bef95744a5d090 to your computer and use it in GitHub Desktop.
Make a real-time progress bar using powershell. example for 2000 ms
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
$elapsedTime = [system.diagnostics.stopwatch]::StartNew() | |
# change value for other timer durations. | |
1..2000 | %{write-progress -activity "Working..." -status "$([string]::Format("Time Elapsed: {0:d2}:{1:d2}:{2:d2}", $elapsedTime.Elapsed.hours, $elapsedTime.Elapsed.minutes, $elapsedTime.Elapsed.seconds))" -percentcomplete ($_/10);} | |
$elapsedTime.stop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment