Search notes:

PowerShell: object members

A PowerShell object has a collection of members. There are two types of members: properties store a value, methods are able to execute some sort of code.
There are quite a few member types which are enumerated in the System.Management.Automation.PSMemberTypes enum.
The members of an object can be shown by piping it to the the get-member cmdLet:
$obj = get-item .
$obj | get-member
Objects that are related to items seem to have the following «special» properties:
psChildName
psDrive
psIsContainer
psParentPath
psPath
psProvider
Such a list can be obtained with the following pipeline:
get-item . | get-member -memberType noteProperty
These ps* properties are even present in the object that are returned by get-content:
PS C:\> ( get-content  someFile.txt )[0] | select-object *
Compare with an object's intrinsic members.

See also

The cmdlet noun member
A PowerShell script can be made more robust by making sure referenced object-members actually exist by using the statement set-strictMode -version 2 in a script.

Index