Below i'm trying to create nested array and to add array elements to it like below
$nArr = @(@('1','3'), @('5','7','9'), @('2','4','6'))
And here is the script to get the above structure
$integ = @(2,3,3)
$nArr = ,@()
$nArr1 = @()
foreach ($pd in $integ) {
for($i=0;$i -lt $pd;$i = $i+1) {
$uinput= Read-Host -Prompt "Assign the pod numbers for"
Write-Output `n
$nArr1 += [array]$uinput
}
$nArr += @($nArr1)
}
Inputs I gave for $uinput
is 1,3,5,7,9,2,4,6
But the final structure I got through the above script is
$nArr = @('1','3','5','7','9','2','4','6')
Suggestions please!