You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/automation/automation-child-runbooks.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -29,13 +29,13 @@ Which runbook types can call each other?
29
29
30
30
* A [PowerShell runbook](automation-runbook-types.md#powershell-runbooks) and a [graphical runbook](automation-runbook-types.md#graphical-runbooks) can call each other inline, as both are PowerShell-based.
31
31
* A [PowerShell Workflow runbook](automation-runbook-types.md#powershell-workflow-runbooks) and a graphical PowerShell Workflow runbook can call each other inline, as both are PowerShell Workflow-based.
32
-
* The PowerShell types and the PowerShell Workflow types can’t call each other inline, and must use **Start-AzAutomationRunbook**.
32
+
* The PowerShell types and the PowerShell Workflow types can't call each other inline, and must use `Start-AzAutomationRunbook`.
33
33
34
34
When does publish order matter?
35
35
36
36
The publish order of runbooks only matters for PowerShell Workflow and graphical PowerShell Workflow runbooks.
37
37
38
-
When your runbook calls a graphical or PowerShell Workflow child runbook using inline execution, it uses the name of the runbook. The name must start with **.\\** to specify that the script is located in the local directory.
38
+
When your runbook calls a graphical or PowerShell Workflow child runbook using inline execution, it uses the name of the runbook. The name must start with `.\\` to specify that the script is located in the local directory.
> If your runbook invokes a child runbook with the **Start-AzAutomationRunbook** cmdlet with the *Wait* parameter and the child runbook produces an object result, the operation might encounter an error. To work around the error, see [Child runbooks with object output](troubleshoot/runbooks.md#child-runbook-object) to learn how to implement the logic to poll for the results using the [Get-AzAutomationJobOutputRecord](/powershell/module/az.automation/get-azautomationjoboutputrecord) cmdlet.
59
+
> If your runbook invokes a child runbook with the `Start-AzAutomationRunbook` cmdlet with the `Wait` parameter and the child runbook produces an object result, the operation might encounter an error. To work around the error, see [Child runbooks with object output](troubleshoot/runbooks.md#child-runbook-object) to learn how to implement the logic to poll for the results using the [Get-AzAutomationJobOutputRecord](/powershell/module/az.automation/get-azautomationjoboutputrecord) cmdlet.
60
60
61
-
You can use **Start-AzAutomationRunbook** to start a runbook as described in [To start a runbook with Windows PowerShell](start-runbooks.md#start-a-runbook-with-powershell). There are two modes of use for this cmdlet. In one mode, the cmdlet returns the job ID when the job is created for the child runbook. In the other mode, which your script enables by specifying the *Wait* parameter, the cmdlet waits until the child job finishes and returns the output from the child runbook.
61
+
You can use `Start-AzAutomationRunbook` to start a runbook as described in [To start a runbook with Windows PowerShell](start-runbooks.md#start-a-runbook-with-powershell). There are two modes of use for this cmdlet. In one mode, the cmdlet returns the job ID when the job is created for the child runbook. In the other mode, which your script enables by specifying the *Wait* parameter, the cmdlet waits until the child job finishes and returns the output from the child runbook.
62
62
63
63
The job from a child runbook started with a cmdlet runs separately from the parent runbook job. This behavior results in more jobs than starting the runbook inline, and makes the jobs more difficult to track. The parent can start more than one child runbook asynchronously without waiting for each to complete. For this parallel execution calling the child runbooks inline, the parent runbook must use the [parallel keyword](automation-powershell-workflow.md#parallel-processing).
64
64
65
-
Child runbook output does not return to the parent runbook reliably because of timing. In addition, variables such as *$VerbosePreference*, *$WarningPreference*, and others might not be propagated to the child runbooks. To avoid these issues, you can start the child runbooks as separate Automation jobs using **Start-AzAutomationRunbook** with the *Wait* parameter. This technique blocks the parent runbook until the child runbook is complete.
65
+
Child runbook output does not return to the parent runbook reliably because of timing. In addition, variables such as `$VerbosePreference`, `$WarningPreference`, and others might not be propagated to the child runbooks. To avoid these issues, you can start the child runbooks as separate Automation jobs using `Start-AzAutomationRunbook` with the `Wait` parameter. This technique blocks the parent runbook until the child runbook is complete.
66
66
67
-
If you don’t want the parent runbook to be blocked on waiting, you can start the child runbook using **Start-AzAutomationRunbook** without the *Wait* parameter. In this case, your runbook must use [Get-AzAutomationJob](/powershell/module/az.automation/get-azautomationjob) to wait for job completion. It must also use [Get-AzAutomationJobOutput](/powershell/module/az.automation/get-azautomationjoboutput) and [Get-AzAutomationJobOutputRecord](/powershell/module/az.automation/get-azautomationjoboutputrecord) to retrieve the results.
67
+
If you don't want the parent runbook to be blocked on waiting, you can start the child runbook using `Start-AzAutomationRunbook` without the `Wait` parameter. In this case, your runbook must use [Get-AzAutomationJob](/powershell/module/az.automation/get-azautomationjob) to wait for job completion. It must also use [Get-AzAutomationJobOutput](/powershell/module/az.automation/get-azautomationjoboutput) and [Get-AzAutomationJobOutputRecord](/powershell/module/az.automation/get-azautomationjoboutputrecord) to retrieve the results.
68
68
69
69
Parameters for a child runbook started with a cmdlet are provided as a hashtable, as described in [Runbook parameters](start-runbooks.md#runbook-parameters). Only simple data types can be used. If the runbook has a parameter with a complex data type, then it must be called inline.
70
70
@@ -74,7 +74,7 @@ If jobs within the same Automation account work with more than one subscription,
74
74
75
75
### Example
76
76
77
-
The following example starts a child runbook with parameters and then waits for it to complete using the **Start-AzAutomationRunbook** cmdlet with the *Wait* parameter. Once completed, the example collects cmdlet output from the child runbook. To use **Start-AzAutomationRunbook**, the script must authenticate to your Azure subscription.
77
+
The following example starts a child runbook with parameters and then waits for it to complete using the `Start-AzAutomationRunbook` cmdlet with the `Wait` parameter. Once completed, the example collects cmdlet output from the child runbook. To use `Start-AzAutomationRunbook`, the script must authenticate to your Azure subscription.
78
78
79
79
```azurepowershell-interactive
80
80
# Ensure that the runbook does not inherit an AzContext
Copy file name to clipboardExpand all lines: articles/automation/automation-edit-textual-runbook.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -53,15 +53,15 @@ Use the following procedure to open a runbook for editing in the textual editor.
53
53
54
54
### Insert an asset into a runbook
55
55
56
-
1. In the Canvas of the textual editor, position the cursor where you want to place the code for the child runbook.
56
+
1. In the Canvas control of the textual editor, position the cursor where you want to place the code for the child runbook.
57
57
2. Expand the **Assets** node in the Library control.
58
58
3. Expand the node for the desired asset type.
59
59
4. Right-click the asset name to insert and select **Add to canvas**. For [variable assets](automation-variables.md), select either **Add "Get Variable" to canvas** or **Add "Set Variable" to canvas**, depending on whether you want to get or set the variable.
60
60
5. Note that the code for the asset is inserted into the runbook.
61
61
62
62
## Editing an Azure Automation runbook using Windows PowerShell
63
63
64
-
To edit a runbook with Windows PowerShell, use the editor of your choice and save the runbook to a ".ps1"file. You can use the [Export-AzAutomationRunbook](/powershell/module/Az.Automation/Export-AzAutomationRunbook) cmdlet to retrieve the contents of the runbook. You can use the [Import-AzAutomationRunbook](/powershell/module/Az.Automation/import-azautomationrunbook) cmdlet to replace the existing draft runbook with the modified one.
64
+
To edit a runbook with Windows PowerShell, use the editor of your choice and save the runbook to a **.ps1**file. You can use the [Export-AzAutomationRunbook](/powershell/module/Az.Automation/Export-AzAutomationRunbook) cmdlet to retrieve the contents of the runbook. You can use the [Import-AzAutomationRunbook](/powershell/module/Az.Automation/import-azautomationrunbook) cmdlet to replace the existing draft runbook with the modified one.
65
65
66
66
### Retrieve the contents of a runbook using Windows PowerShell
0 commit comments