$b = (2,3)
$myarray1 = @(,$b,$b)
$myarray1[0].length #this will be 1
$myarray1[1].length
$myarray2 = @(
,$b
,$b
)
$myarray2[0].length #this will be 2
$myarray[1].length
$myarray3 = @(,$b
,$b
)
$myarray3[0].length #this will be 2
$myarray3[1].length
UPDATE
I think on #powershell IRC we have worked it out, Here is another example that demonstrates the danger of breaking with the comma on the following line rather than the top line when listing multiple items in an array over multiple lines.
$b = (1..20)
$a = @( $b, $b ,$b,
$b, $b ,$b)
for($i=0;$i -lt $a.length;$i++)
{
$a[$i].length
}
"--------"
$a = @( $b, $b ,$b
,$b, $b ,$b)
for($i=0;$i -lt $a.length;$i++)
{
$a[$i].length
}
produces
20
20
20
20
20
20
--------
20
20
20
1
20
20
I'm curious how people will explain this. I think i understand it now, but would have trouble explaining it in a concise understandable fashion, though the above example goes somewhat towards that goal.