I have 2 sets of variables
$numbers = "1","2","3"
$records = "A","B","C"
that I would like to join togther so the final output is
Name Value
---- -----
A {1}
B {2}
C {3}
so far I have managed to build the Arraylist
$numbers = "1","2","3"
$records = "A","B","C"
$total = [ordered] @{}
Foreach ($entry in $records){ $total[$entry] = New-Object Collections.Arraylist }
Which gives me
Name Value
---- -----
A {}
B {}
C {}
However when I try add the numbers in I get this result and I can't figure out what I am doing wrong. Please can someone nudge me in the right direction. Thank you.
ForEach ($row in $numbers)
{ $total[$records] += $row}
Name Value
---- -----
A {}
B {}
C {}
{A, B, C} {, , , 3}