I have two arrays in one outer array
$array1 = @("a", "b")
$array2 = @("c", "d")
$arrayAll = $array1, $array2
I now want to print the names "array1" , "array2" in the foreach-loop
foreach($array in $arrayAll){
Write-Host $array
}
Which returns
a b
c d
with the result that i want would be
$array1
$array2
While $allArray.Count still returns 2 elements. How do i print just the Array names and not what is in the Arrays ?
$arrayAll. Think of a variable like a bag or a purse. If you have two bags filled with marbles - one green bag, one blue bag - and you then empty both of them into a big red bag, then you don't have "a red bag of green-bag and blue-bag marbles" - you just have "a red bag of marbles".