Get-Member Receives Array Contents

by Mar 28, 2013

 

If you need to know the object nature of command results, you probably know that you can pipe them to Get-Member like this:

Get-Process | Get-Member 

A less know fact is that the pipeline always unpacks arrays, so Get-Member will always receive array contents, not the array by itself

If you want to examine an array (or make sure that the object you want to examine is not altered by the pipeline), submit it to Get-Member directly:

Normal
0

false
false
false

EN-US
X-NONE
X-NONE

Get-Member -InputObject (Get-Process)