PowerShell: Restart a Service on All Hyper-V Hosts of a Cluster
$serviceName='vmms' $clusterName='HyperV-cluster001' function restartServiceAllClusterNodes($service='vmms',$clusterName){ function restartService($serviceName){ $waitSeconds=40 $isValidProcess=try{[bool](get-service $serviceName -EA Stop)}catch{$false} if($isValidProcess){ try{ $process=Start-Process -FilePath…
0 Comments