I'm following a PluralSight class on PowerShell. While trying to understand the presenter's examples I've gone down the rabbit hole of understanding how to extract columns from output. In this example I'm reading the Get-Help about Group-Object with examples. Example 5 states "Group process by priority class". If I type the example to this part:

Get-Process | Group-Object -Property 

I can't tab to show a list of properties. In the example it adds "PriorityClass". I searched for this and found what appears to be a descriptive page outlining what is produced by this class.


I see this also is in a hierarchy of properties within the "Process Class". Are all these properties supposed to be within the "Get-Process" command?

If so then I see there is a property called "Handles" which is not listed in the above document but can be called by the Group-Object (or Select-Object) command. Why is this one not listed?

Is there some way to see a list of all properties that can be called - kind of like predictive text (like tabbing) or auto-complete (like ctrl + . in Toad if you're familiar)?

1 Answers

Moerwald On Best Solutions

Get-Member will show you all public properties you can use on the returned object of the PowerShell cmdlet. Check this msdn link for a full description of Get-Member.

A short example:

PS C:\Users\andre> Get-Process | Get-Member

     TypeName: System.Diagnostics.Process

BasePriority               Property       int BasePriority {get;}
Container                  Property       System.ComponentModel.IContainer             Container {get;}
EnableRaisingEvents        Property       bool EnableRaisingEvents {get;set;}
ExitCode                   Property       int ExitCode {get;}
ExitTime                   Property       datetime ExitTime {get;}
Handle                     Property       System.IntPtr Handle {get;}
HandleCount                Property       int HandleCount {get;}
HasExited                  Property       bool HasExited {get;}
Id                         Property       int Id {get;}

Above you can see all useable properties of the System.Diagnostics.Process object returned by Get-Process.

Hope that helps.