I was wondering if there is a shorter way to create a multidimensional hash table array in powershell. I was able to successfully create them using a pair of such strings.
$arr = @{}
$arr["David"] = @{}
$arr["David"]["TSHIRTS"] = @{}
$arr["David"]["TSHIRTS"]["SIZE"] = "M"
That said, I was wondering if there is a way to cut this down to something like this ...
$new_arr["Level1"]["Level2"]["Level3"] = "Test"
Where he will create a new level, if he does not exist yet. Thank!
source
share