Functions/Scripting/Wait-Seconds.ps1
Function Wait-Seconds { [CmdletBinding()] Param ( # Number of Seconds to wait [Parameter(Mandatory=$true)] [int32] $Seconds ) for ($i = $Seconds; $i -ge 1; $i--) { Write-Progress -Activity "Delaying" -CurrentOperation "Waiting $Seconds Seconds" -SecondsRemaining $i -PercentComplete (($Seconds-$i)/$Seconds*100) start-sleep 1 } Write-Progress -Activity "Delaying" -Completed } |