Im having trouble outputting the value of a variable name that is in a variable. I have one array that contains the name of several other arrays like this:
>$arrayx1
array00
array01
array02
array03
array10
array11
array12
array13
Each of those arrays have their own value, I want to output that value to a file in a loop. I got the loop and everything else working, except it outputs the name of the arrays and not the arrays value.
$outnr1 = 0
$outnr2 = 0
$null | out-file $path
foreach ($nr3 in $arrayx1) {
$output = $arrayx1[$outnr2]
echo "$($output)" | out-file $path -encoding Unicode -append
$outnr2 = $outnr2 + 1
if ($outnr2 -gt 3) {
$outnr1 = $outnr1 + 1
}
}
The file ends up looking like $arrayx1
Get-Variablecmdlet.