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
