Skip to content

Commit dc60c75

Browse files
authored
Merge pull request #14045 from AnatoliB/patch-1
Update automation-hrw-run-runbooks.md
2 parents 173d2a6 + 24da8d0 commit dc60c75

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

articles/automation/automation-hrw-run-runbooks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ By default, runbooks run in the context of the Local System account for Windows
4141

4242
You can use [Credential](automation-credentials.md) and [Certificate](automation-certificates.md) assets in your runbook with cmdlets that allow you to specify credentials so you can authenticate to different resources. The following example shows a portion of a runbook that restarts a computer. It retrieves credentials from a credential asset and the name of the computer from a variable asset and then uses these values with the Restart-Computer cmdlet.
4343

44-
```azurepowershell-interactive
45-
$Cred = Get-AzureRmAutomationCredential -ResourceGroupName "ResourceGroup01" -Name "MyCredential"
46-
$Computer = Get-AzureRmAutomationVariable -ResourceGroupName "ResourceGroup01" -Name "ComputerName"
44+
```powershell
45+
$Cred = Get-AutomationPSCredential -Name "MyCredential"
46+
$Computer = Get-AutomationVariable -Name "ComputerName"
4747
4848
Restart-Computer -ComputerName $Computer -Credential $Cred
4949
```

0 commit comments

Comments
 (0)