Using GetType() on an array reports that it is an Object[] with a Base Type of System.Array.
However, using Get-Member on an array gives the members for the objects stored in the array and not of an array object.
What can I use to see the properties and methods available on an array which would include Count and Length properties?
This does not appear to be the same for a hash collection. Using Get-Member on a hash on a System.Collections.Hashtable returns the properties and methods of a hash, not the contents of the hash.
$a = @(1,2)
$a
Write-Host '=== Array is created'
$a.GetType()
$a | Get-Member | Format-Table
Write-Host '=== Second element of array'
$a[1]
$a[1].GetType()
$a[1] | Get-Member | Format-Table
I think what you are looking for is
Get-Member -InputObject $a
To retrieve the content of a hashtable I would recommend taking a look at the following information: https://technet.microsoft.com/en-us/library/ee692803.aspx
I would also recommend taking a look at the gitter channel on the front page of this repo for help with Powershell usage.
Closing as resolved. Please let me know if there is more to this issue that needs to be reopened.
Most helpful comment
I think what you are looking for is
Get-Member -InputObject $aTo retrieve the content of a hashtable I would recommend taking a look at the following information: https://technet.microsoft.com/en-us/library/ee692803.aspx
I would also recommend taking a look at the gitter channel on the front page of this repo for help with Powershell usage.