title: cloning multiple VMs in parallel with multithreaded PowerCLI
body: <p>I've taken on the task of cloning a ton of VMs in VMware.  Rather than clicking hundreds of times through the clone wizard, I'd like to automate this as much as possible.</p>
  
  <p>I've got the template machine already configured and "sealed."  Once it's cloned and powered on, the newly-cloned instance will boot up, sit there for a while while it syspreps, etc.  This takes about 20 minutes or so.</p>
  
  <p>I found a very nice <a href="http://gallery.technet.microsoft.com/scriptcenter/c74b4a23-e4ec-4829-b38e-54252b40fdec" rel="nofollow">script over on MSFT TechNet</a> that does everything I need it to do.  I've modified it a little bit so I don't have to change a value and re-save the script for each step of the process.  Instead of the $Step counter throughout the script, I've simply replaced it with some Start-Sleep delays.  At this point, it works fine and successfully clones all the machines that it reads in from a CSV file.  Each machine takes about 35 minutes before it's ready to go (machine is moved to a different AD OU).</p>
  
  <p>The only problem is it's running all serially, waiting for the entire process (clone, change VLAN, boot machine and wait for domain join, and move final machine object to a different AD OU) to finish before starting another clone.</p>
  
  <p>What I'd really like to somehow is multithread it to make the whole operation faster.  I've found in testing that cloning within vSphere starts to slow down once about five separate clone jobs are running, so I'd like to modify this script to run four clones (doing the whole workflow) at once.</p>
  
  <p>Any ideas?  I can paste the code if needed.</p>