Samples/Event Consumers/Windows/Support/Restart Windows Service.ps1

1
2
3
4
$ServiceName = 'PS3 Media Server'
$Service = Get-WmiObject -Namespace root\cimv2 -Class Win32_Service -Filter "Name = '$Service'"
$Service.StopService()
$Service.StartService()