I have a script in a runbook that dynamically executes a background job using another script, also placed on disk, but there is no output from that background job even if I explicitly ask for the result with Receive-Job.
Here’s the code I run to execute the external script as a background job and then get the results:
$job = Start-Job -FilePath $pathToScript
The runbook executes without problems but there is no output. If I use the following method to invoke the external script I get the expected output from the runbook:
I would like to use background jobs though as there are benefits to that I’d like to use. Can I use background jobs with Calm and if so, how?