Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

using names passed to -ComputerName in the output

$
0
0

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)?


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>