PowerShell function to pause with a progress bar…

Soem time ago I wrote a script for a customer which does some things in the background that may take quite some time.
So from their perspective the script would ‘hang’.

To avoid this experience I’ve written a small function to provide a somewhat better experience by showing a progress bar.

Note that the purpose of this function is to be functional, not to be accurate. The script takes some milliseconds to execute, which are not deducted from the pause.

In my case I had the advantage of calculating the time for script to execute, which I’ve taken as input for the function above. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *