<# .SYNOPSIS Display & update progress bar .DESCRIPTION For this we will be counting for 1 minute; the Start-Sleep function is 1 second By looping through each second and calculating the percent complete we can update the progess bar. #> # Get-Help wont work if script starts with function... Write-Host "`n" (Get-Help $PSCommandPath).synopsis function Test-ProgressBar { Write-Host -fore Cyan "Let's just take a minute to relax..." For ($i = 0; $i -le 60; $i++) { Write-Progress -Activity "I'll count. $i second[s]" -percentComplete ($i / 60 * 100) Start-Sleep 1 } }