I have a Jenkins pipeline that contains a step 'powershell'. From the powershell script, I want to execute some actions in parallel. powershell has the Workflow concept for this (not to confuse with Jenkins workflow).
If I execute the script from the powershell console, everything works OK. If I execute the same script from within a Jenkins pipeline, it hangs. The only output I see is:
The Jenkins pipeline script is as follows (it contains some commented lines to make changes easy, see below):
The script as it is hangs.
However, if I make the following changes (independently, i.e. each change on its own is sufficient), it does not hang:
- If I "inline" the function execFunc, i.e. activate the line 'Change 1' and comment the line above (the call to execFunc), the script does not hang
- If I replace the parallel execution with the sequential one, i.e. activate the line 'Change 2' and comment the line above (call to 'execInParallel'), then the script does not hang.
The hanging only occurs if I use the powershell workflow and call a function from within it.
In an earlier version of the "Pipeline: Nodes and Processes" plugin (I think, it was 2.17, but I'm not sure), everything worked OK.
The job itself is named "zzzTestPowershellWorkflow" I.e. the name does not contain any "bad" characters (spaces or the like).