Contact Info

Crumbtrail » Administration » Powershell » Powershell 1.0 » Get-Member

Get-Member - Powershell 1.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »


Enumerate the properties of an object

Get-Member [ [-name] string[] ]  [-inputObject psobject]
        [-memberType memberType  [-static] [CommonParameters]

        The member name(s) to retrieve information about.

        The objects to retrieve information about.
        The type of members to retrieve information about. 
        Valid member types are: AliasProperty, CodeProperty,
        Property, NoteProperty, ScriptProperty, Properties,
        PropertySet, Method, CodeMethod, ScriptMethod, Methods,
        ParameterizedProperty, MemberSet, and All.

        Retrieve static properties and methods.
       -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutVariable.

Display the properties of a Process object: (.Net Framework Class Library System.Diagnostics.Process)

PS C:\>get-process | get-member -MemberType property

Display the properties of an Alias object:

PS C:\>get-alias | get-member

or using a variable:
PS C:\>$alias = get-alias
$alias | get-member

Display the properties of the container object, a System.Object array:

PS C:\>$alias = get-alias
get-member -inputobject $alias

Piping a command into get-member twice will display the properties of the parent object: Powershell.Commands.MemberDefinition:

PS C:\>get-process | get-member | get-member

Pipelining a container object, will run get-member for each element in the container.
Using the -InputObject parameter, will run get-member for the container object itself.
Prefixing the pipelined input with a comma will also force get-member to run against the container object:
PS C:\>,$alias | get-member