I'm working with a PowerShell script that runs quietly in the background, and I'm looking to create a separate script that shows a visible progress bar. The goal is to inform users about which line the source script is currently processing. For instance, when the script reaches a line that says '* application closed', I want the progress bar to display 'application closed'. Ideally, I'd like this progress bar to appear in a single window that will close after processing a specific line. Does anyone have suggestions on how to implement this?
3 Answers
How are you executing the second script? Understanding how you’re waiting for it to finish can help us figure out the best way to communicate between your scripts.
You could try using Start-Transcript along with Write-Progress. Alternatively, create your own counter within your loop (like using for, foreach, or while) and utilize Write-Verbose to display messages.
Have you considered using the Write-Progress cmdlet? It’s a built-in way to show a progress bar in PowerShell. You can call it from within your silent script to display updates as the lines are processed.

I tried using Write-Progress, but it didn’t work because the main script is silent. I need a way to link it to a viable progress bar that shows each processed line.