Occasionally, you do not know the exact progress of your script but you’d still like to inform the user that your script is “busy”. If you run your PowerShell scripts on Windows, you can use the taskbar button to display an indeterminate progress bar. This progress bar runs “forever” until you turn it off again.
All you need is install this module:
Install-Module -Name PsoProgressButton -Scope CurrentUser
Next, you can run the command below to turn on the indeterminate progress bar. It displays inside the taskbar button that represents your running PowerShell script:
PS> Set-PsoButtonProgressState -ProgressState Indeterminate
To turn the indicator off again, run this:
PS> Set-PsoButtonProgressState -ProgressState NoProgress