I am sure I mentioned this before (I read it in a blog post somewhere and has usually served me well): Get-Member
has a quirk when it comes to arrays in that if you pipe it an array it will give you the members of the elements of the array, not the members of the array itself.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# piping an array of integers returns the members of integers PS> 1,2 | get-member TypeName: System.Int32 ... # piping an array of characters returns members of the characters PS> 'a','b' | get-member TypeName: System.String ... # piping an array of integers and characters returns members of both PS> 'a',1 | get-member TypeName: System.String ... TypeName: System.Int32 ... |
To get the members of the array itself, use the -InputObject
parameter:
1 2 3 4 |
PS> get-member -InputObject 1,2 TypeName: System.Object[] ... |