@Ponkam, Sumanth (Cognizant), to ensure that you do not wait for the child runbook to complete before executing the next line, the Start-AzAutomationRunbook without -wait
parameter.
For details, see Start a child runbook by using a cmdlet.
The sample runbook snippet is as below:
# Ensure that the runbook does not inherit an AzContext
Disable-AzContextAutosave -Scope Process
# Connect to Azure with system-assigned managed identity
$AzureContext = (Connect-AzAccount -Identity).context
# set and store context
$AzureContext = Set-AzContext -SubscriptionName $AzureContext.Subscription -DefaultProfile $AzureContext
$params = @{"VMName"="MyVM";"RepeatCount"=2;"Restart"=$true}
Start-AzAutomationRunbook -AutomationAccountName 'MyAutomationAccount' -Name 'Test-ChildRunbook' -ResourceGroupName 'LabRG' -DefaultProfile $AzureContext -Parameters $params
<continue PowerShell code further>
Hope this helps.
If the answer did not help, please add more context/follow-up question for it. Else, if the answer helped, please click Accept answer so that it can help others in the community looking for help on similar topics.