How to Display a Progress Bar in PowerShell for a Silent Script?

September 14, 2025 3 answers
Asked by CodingNinja77
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?

Answers

TechyGuru29
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.

CodingNinja77: 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.

Reply to this answer
ScriptMaster99
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.
Reply to this answer
WizardOfPowershell
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.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions