liveBook · Manning

Get-Member

As explained in Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS

Get-Member is a PowerShell cmdlet that displays the members, including properties and methods, of input objects.

Get-Member inspects PowerShell objects when command help is not enough. It lists an object's members, including properties and methods; use the shorter alias gm when exploring pipelines. section 8.3

Inspect process objects

Run Get-Process | gm. The output includes the object type, member names, member kinds, and definitions. Because the complete process objects remain in the pipeline before display formatting, Get-Member can inspect properties and methods that are not visible in the normal table. section 8.3

PS C:\> Get-Process | gm
   TypeName: System.Diagnostics.Process
Name                       MemberType     Definition
----                       ----------     ----------
Handles                    AliasProperty  Handles = Handlecount
Name                       AliasProperty  Name = ProcessName
NPM                        AliasProperty  NPM = NonpagedSystemMemo...
PM                         AliasProperty  PM = PagedMemorySize
VM                         AliasProperty  VM = VirtualMemorySize
WS                         AliasProperty  WS = WorkingSet
Disposed                   Event          System.EventHandler Disp...
ErrorDataReceived          Event          System.Diagnostics.DataR...
Exited                     Event          System.EventHandler Exit...
OutputDataReceived         Event          System.Diagnostics.DataR...
BeginErrorReadLine         Method         System.Void BeginErrorRe...
BeginOutputReadLine        Method         System.Void BeginOutputR...
CancelErrorRead            Method         System.Void CancelErrorR...
CancelOutputRead           Method         System.Void CancelOutput...

Use the listing to recognize the TypeName, MemberType, property aliases, events, and methods returned for process objects. section 8.3

Keep these inspection habits in mind:

  • Append Get-Member only where the preceding command produces objects; commands producing no output give it nothing to inspect. section 8.9
  • Track the object type at every pipeline step. Get-Member itself outputs MemberDefinition objects, so Get-Process | gm | gm inspects a different object type. section 8.8
  • Verify real property names with Get-Member rather than relying on formatted column headings, which may use display labels such as PM(MB). section 12.4

Find method documentation

Pipe a process to Get-Member and look for methods such as Kill or Start. Use the displayed complete TypeName, such as System.Diagnostics.Process, to locate documentation for that type and its methods. section 15.5.3

How Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS covers it

How deep it goes
Explains member listings, pipeline object types, and display-name differences, but stops short of detailed method implementation.
Examples
Demonstrates process inspection, recursive member inspection, method lookup, and property discovery for filtering and module exercises.
What it assumes
Assumes commands such as Get-Process produce pipeline output and teaches object members, type names, and property inspection through examples.
What you can do after
Diagnose pipeline behavior and build filters by identifying the actual object type, properties, and methods available at each step.
How it connects
Connects PowerShell objects, pipelines, properties, methods, type names, Get-Help, and Where-Object.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS. The section links point to the parts of the book it draws on.