I\'m trying to loop through a hash table and set the value of each key to 5 and PowerShell gives an error:
$myHash = @{} $myHash[\"a\"] = 1 $myHash[\"b\"] =
You have to get creative!
$myHash = @{} $myHash["a"] = 1 $myHash["b"] = 2 $myHash["c"] = 3 $keys = @() [array] $keys = $myHash.keys foreach($key in $keys) { $myHash.Set_Item($key, 5) } $myHash Name Value ---- ----- c 5 a 5 b 5