Quick and Dirty Script to Watch and Start / Restart Windows Service

// powershell.exe
// -ExecutionPolicy Bypass c:\scripts\serviceCheck.ps1
$serviceName = '[input-service-name-here]'
$arrService = Get-Service -Name $serviceName
while ($arrService.Status -ne 'Running')
{
Start-Service $serviceName
$arrService.Refresh()
}

Leave a Reply

Your email address will not be published. Required fields are marked *