For example
a = @(
"test1",
"test2"
)
b = @(
"test3",
"test4"
)
one is
foreach ($c in $a) {
ehco $c
}
What should I do if I have more than one?
You cannot do a foreach on more than one object. You can do a for loop, but it will break if the arrays are not of the same size Here's an example with a check on the arrays size:
if ($a.Count -eq $b.Count)
{
for ($i=0; $i -lt $a.count; $i++)
{
$a[$i]
$b[$i]
}
}