Posted On March 31, 2019

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

kimconnect 0 comments
blog.KimConnect.com >> Windows >> 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 *

Related Post

How to Change iTunes Backup Location of Storage In Windows

Make a directory junction after moving the backup storage location robocopy "C:\Users\%USERNAME%\AppData\Roaming\Apple Computer\MobileSync" "D:\iphone_backups" /E…

Windows Event ID 2017: Unable to collect NUMA physical memory utilization data

Issue: Log Name: ApplicationSource: Microsoft-Windows-PerfOSDate: 9/12/2018 7:47:38 AMEvent ID: 2017Task Category: NoneLevel: WarningKeywords: ClassicUser: N/AComputer:…