powershell - How to compare and restart same many Services on many Computers with simple interface -
i need compare status of many services , each dependancy on many remote computer restart if needed. but output of get-service poor in cli you can pipe get-service out-gridview, get-service accept list of computername. get-service -computername pc1,pc2 | out-gridview -outputmode multiple | restart-service -force -passthru the function out-gridview provide user interface. function restartrmservice { param ( [parameter(mandatory=$true,position=0)] [alias("cn")] [string[]]$computername, [parameter(mandatory=$false)] [alias("cn")] [string[]]$servicename ) $restart = @() if ($servicename) { $restart = get-service -computername ($computername | select-object -unique) -name $servicename | select * } else { $restart = get-service -computername ($computername | select-object -unique) | select machinename, servicename, status, displayna...