Title says it all, I guess.
I am trying to modularize my runbooks and all I want to do is start child RBs using the internal Automation module 'Start-AutomationRunbook' AND get back the result.
This is the sample code I am testing with:
Parent RB:
$result = Start-AutomationRunbook -Name ChildRB
Write-Output $result
Child RB:
$hello = 'Hello world!'
Write-Output $hello
However, instead of storing 'Hello world!' in $result the Job ID is sent to the console.
I posted the same question here: https://learn.microsoft.com/en-us/answers/questions/1417541/how-can-i-retrieve-output-from-azure-powershell-ch
And I received the following answer, which actually works:
Kudos to AnuragSingh-MSFT !!!