r/PowerShell • u/Net-Runner • Aug 18 '17
Script Sharing How To Create Progress Bars in PowerShell
https://mcpmag.com/articles/2017/08/17/create-progress-bars-in-powershell.aspx
126
Upvotes
r/PowerShell • u/Net-Runner • Aug 18 '17
2
u/jagrock84 Aug 19 '17
Nice article. I only caution that, as with writing to console, it slows down scripts if there are lots of processes. I tend to create a stop watch before the main loop I want to have a progress and only update the progress bar every 1 sec. For script I have running against 50k objects, this can shave off several minutes.
As you can see in the example below, it's 60 seconds updating progress every time. The whole process takes less than a sec in the 2nd one (I put in an extra if condition to force the progress to show at least once).