Reputation: 17011
How can I find what properties object $a
has in the following?
$a = 1
$a.length
$a | Get-Member
Get-Member does not seem to produce any properties for object $a
? Is length a property
of object $a
?
Upvotes: 35
Views: 53769
Reputation: 141
You can also pipe a sample object to Select-Object to see all properties and their values.
get-process | select -first 1 -prop *
Upvotes: 14
Reputation: 126902
$a is an Integer, it doesn't have a length property. Using Get-member is the right way to find object properties.
Upvotes: 29