Group-Object and GroupInfo objects
A couple of days ago, I was the generic group-objects cmdlet:
- Get-Service | Group status
This command showed me the numbers of running and stopped services on a computer. The count column is fine and all but the [Group] column itself looked like this:
- Group
- -----
- {System.ServiceProcess.ServiceController, System.ServiceProcess.ServiceController, S...
- {System.ServiceProcess.ServiceController, System.ServiceProcess.ServiceController, S...
I wanted to see the service name beyond the ‘…’. To get that information returned back to you, you can use the following; It will list you all the services that are stopped. Change the array from [0] to [1] will show you the running services:
- (Get-Service | Group status)[0].group



