|
|
I am having trouble getting consistent behavior with the following syntax
$array1 = [ at ]([ at ]('first set item 1', 'first set item 2', 'first set item3'), [ at ]('second set item 1', 'second set item2', 'second set item 3')) $array2 = [ at ]([ at ]('first set item 1', 'first set item 2', 'first set item3'))
What I am creating is an array of arrays....if I pass each of these into a function:
function ArrayTest { param ($items)
foreach ($item in $items) { '{0} {1} {2} {3}' -f $item[0], $item[1], $item[2], $item[3] } }
when $array2 is passed in, the foreach loop decomposes $items into the four pieces and the [1], [2] annd [3] items are $null
This seems to be inconsistent handling of arrays and I am wondering what the logic behind this behavior is
Thanks
|
|
|