$vcconnect
has 50 machines and I need to run this job on all 50 machines, but when I just run it, it crashes the shell.
I would like to limit the parallel execution to 10 at a point of time.
I tried a do-while but I was missing something as it executed on all 50 at same time and crashed my shell.
foreach($vci in $vcconnect){
[array]$jobstart += Start-Job -Name top2 -ArgumentList @($vci, $cred, $from, $to) -ScriptBlock $importcode
}