I am trying to trigger a powershell workflow which should spin 10 threads in parallel. I am using PS version 4. Code -
Workflow CreateVMs
{
$i = 0
#somecodehere...
foreach -parallel -throttlelimit 10($i in 0..30)
{
#somemorecodehere...
# INVOKING BATCH FILE USING POWERSHELL
}
}
I am invoking batch files using powershell inside my inline script. What I observed in the task manager is, only 5 threads were active at a time-
May be the next thread getting picked up only one of the five is completed. I never saw more than 5 ps instance. However, When i checked the ps sessions allowed per user it is far more than 5.
How can I spin 10 threads of PS in parallel in a PS workflow. What am I missing here ?