Powershell gridview

Soldato
Joined
8 Mar 2005
Posts
3,686
Location
London, UK
Using powershell I wish to hack together a test harness/health check style script which enumerates various bits of data onto a single line and consolidates all data to output to a CSV.

Since there are a considerable number of servers my thought process was to wrap this child script into a parent job script.

The parent job script works as expected and dumps out output to csv format from the child script.

However in this example I want check the statuses of multiple services running on a server. Currently the child script is nothing more complicated than
Code:
Get-Service - ComputerName $computer -Name Appsense* | Select Name, MachineName, status

However as expected this generates a line of output for every service that meets the criteria which is expected. However I wish for it to output a single line similar to:

Server ServiceName1 ServiceName2 ....
servera Running Stopped ....
serverb Running Running ....

I appreciate in order to reduce additional validation checks I may have to drop wildcards from the initial Get-Service query and build up the table view using multiple Get-Service queries within the child script.

Any pointers/examples, greatly appreciated.

cheers, Paul.
 
Back
Top Bottom