Skip to content

Commit 58b2db5

Browse files
committed
Reflecting Az module
1 parent 236e363 commit 58b2db5

12 files changed

+209
-206
lines changed

articles/automation/automation-child-runbooks.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ Which runbook types can call each other?
2929

3030
* 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.
3131
* 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 cant 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`.
3333

3434
When does publish order matter?
3535

3636
The publish order of runbooks only matters for PowerShell Workflow and graphical PowerShell Workflow runbooks.
3737

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.
3939

4040
### Example
4141

@@ -56,15 +56,15 @@ $output = .\PS-ChildRunbook.ps1 –VM $vm –RepeatCount 2 –Restart $true
5656
## Starting a child runbook using a cmdlet
5757

5858
> [!IMPORTANT]
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.
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.
6060
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.
6262

6363
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).
6464

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.
6666

67-
If you dont 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.
6868

6969
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.
7070

@@ -74,7 +74,7 @@ If jobs within the same Automation account work with more than one subscription,
7474

7575
### Example
7676

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.
7878

7979
```azurepowershell-interactive
8080
# Ensure that the runbook does not inherit an AzContext

articles/automation/automation-edit-textual-runbook.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ Use the following procedure to open a runbook for editing in the textual editor.
5353

5454
### Insert an asset into a runbook
5555

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.
5757
2. Expand the **Assets** node in the Library control.
5858
3. Expand the node for the desired asset type.
5959
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.
6060
5. Note that the code for the asset is inserted into the runbook.
6161

6262
## Editing an Azure Automation runbook using Windows PowerShell
6363

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.
6565

6666
### Retrieve the contents of a runbook using Windows PowerShell
6767

0 commit comments

Comments
 (0)