I have issues publishing a PowerShell workflow. Most of the script I am using is run in sequence, including the first for loop. But I would like to final for loop to execute in parallel. The code is as follows:
workflow myWorkflow {
code..
code..
regular for loop
foreach -parallel
}
myWorkflow
An error occured while publishing the runbook 'myWorkflow'. Error details: The Runbook definition is invalid. The '-parallel' parameter can be used only within a workflow. The Runbook definition must contain only one definition which is workflow.. Error code: BadRequest..
The code runs very slow otherwise. Is there an issue with my code or the setup of the script?