Hi guys,
I am trying to execute several simultaneous uploads to different ESXi servers.
I follow KB 2001041.
I am using Start-Job cmdlet with ScriptBlocks.
The output of the Get-Job cmdlet says, that those jobs are running sequentially. The next job starts after the previous has ended.
Please, could you give me an advice, how to run this kind of jobs simultaneously?
Thank you
No problem :smileygrin:
After a quick look at your code, the reason why your background run in sequence, is due to the Wait-Job you have.
You can submit all Jobs and then move the Wait-Job outside of the foreach loop.
Your last lines could look like this
}
Get-Job | Wait-Job
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
It would help if you could show us your code.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
No problem :smileygrin:
After a quick look at your code, the reason why your background run in sequence, is due to the Wait-Job you have.
You can submit all Jobs and then move the Wait-Job outside of the foreach loop.
Your last lines could look like this
}
Get-Job | Wait-Job
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you very much.
Your idea is correct.
Best regards
Jiří