Write-Progress Help

In my script I have a Try and Catch block. Â Inside my catch block I’m calling five functions. Â These functions take a minute or two to complete. I would love to show my end user a progress bar when these functions are executing. Â I’ve asked the Google this question. Â It returns varying results, but none that make it clear how I should handle this. Â I’m curious if anyone has some pointers?

Since I have 5 functions I figure I could just write-progress for each function starting at 20% and increasing until the 5th one is done.

Put a line like this just before each of your 5 steps, but use 99 for the percent at the last item:

Write-Progress -Activity "Processing Catch Actions" -CurrentOperation "What I'm Doing Now" -PercentComplete 20

Put a line like this at the end of the catch block:

Write-Progress -Activity "Processing Catch Actions" -Completed

Thank you very much Art. Â Just what I needed.