Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find properties of an object?

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?

like image 483
jrara Avatar asked Sep 11 '11 11:09

jrara


2 Answers

$a is an Integer, it doesn't have a length property. Using Get-member is the right way to find object properties.

like image 70
Shay Levy Avatar answered Nov 13 '22 08:11

Shay Levy


You can also pipe a sample object to Select-Object to see all properties and their values.

get-process | select -first 1 -prop *
like image 23
Jeffery Hicks Avatar answered Nov 13 '22 09:11

Jeffery Hicks