$computernames=@(
"COMPUTER1",
"COMPUTER2"
)
$serviceName='windows_exporter'
get-service $serviceName -computername $computernames|start-Service
get-service $serviceName -computername $computernames|select MachineName,Name,Status
Sample output:
MachineName Name Status
----------- ---- ------
COMPUTER1 windows_exporter Running
COMPUTER2 windows_exporter Running
Categories: