This is my powershell code to iniltialize and populate the hash of hash
$thash = @{};
$thash.add("10.192.200.35",@{OS="XP";BIT="32"})
$thash.add("10.192.200.36",@{OS="XP";BIT="64"})
$thash.add("10.192.200.37",@{OS="XP";BIT="32"})
I am trying to iterate and access the elements in the hash of hash like this
foreach($index in $thash)
{
echo $thash[$index]["BIT"];
echo $thash[$index]["OS"]
}
But i am getting the error
Cannot index into a null array.
At line:
+ echo $thash[$index][ <<<< "BIT"];
+ CategoryInfo : InvalidOperation: (BIT:String) [], RuntimeException
+ FullyQualifiedErrorId : NullArray
How can i access the underlying keys inside the hash of hash?