I'm looking to perform math on two arrays but i'm always ending up executing on the arrays itself and not it elements. how do i call each element from both arrays and perform math on them one by one?
$array1 = (1,2,3)
$array2 = (1,2,3)
$do | % {$array1 + $array2}
this adds the arrays together as in:
1
2
3
1
2
3
but the result i am looking for is the following:
2
4
6
how do i have to go about this?
0..($array1.length-1)|%{$array1[$_]+$array2[$_]}