Hey guys,
Would you be able to help me? When I use the -ComputerName switch in a cmdlet, or function, I get the results as expected. For example:
Get-Service -ComputerName server1, server2 -Name myservice*
Status Name DisplayName
------ ---- -----------
Running MyService... MyService.WindowsService1
Running MyService... MyService.WindowsService2
Running MyService... MyService.WindowsService3
Running MyService... MyService.WindowsService1
Running MyService... MyService.WindowsService2
Stopped MyService... MyService.WindowsService3
That’s fine for me at the time. However if I want to automatically email the results, they’re worthless. Is there a clean way to get the output to include the targeted server’s name (maybe in the table’s 1<sup>st</sup> column)?