PowerShell: Iterate over array that contains name/value pairs
In PowerShell, when an array is assigned to an array with fewer elements ($e1, $e2, $rest = $a, $b, $c, $d…), the values of $e… are assigned from the left ($e1 = $a, $e2 = $b etc.) and the last element $rest is assigned the remaining values as an array. This feature can be used to iterate over an array that contains name/value pairs, as showh in the following simple example script: