$svc = Get-Service W3SVC while($svc.State -ne 'Stopped') { Start-Sleep -Seconds 1 } ... do your thing here...
Tags:sleep, while Posted in Powershell | No Comments »