【发布时间】:2020-10-23 10:32:52
【问题描述】:
我想从 PowerShell 为 Azure Automation Runbook 创建自动化计划。我不希望它默认在 Azure 上运行,而是在 Hybrid Worker 上运行,它存在于我的 Hybrid worker groups 中。
所以我有这个命令:
Import-AzureRmAutomationRunbook -Name $runbookName `
-Path $scriptPath `
-ResourceGroupName $automationResourceGroupName `
-AutomationAccountName $automationAccountName `
-Type PowerShellWorkflow
Publish-AzureRmAutomationRunbook -Name $runbookName `
-AutomationAccountName $automationAccountName `
-ResourceGroupName $automationResourceGroupName
New-AzureRmAutomationSchedule -Name $runbookName `
-AutomationAccountName $automationAccountName `
-StartTime $StartTime `
-ExpiryTime $EndTime `
-DayInterval 1 `
-ResourceGroupName $automationResourceGroupName
可以从 Azure 门户手动完成:
但我需要从 PowerShell 完成。我在 MS 文档上找不到它。
【问题讨论】:
标签: azure powershell azure-automation azure-runbook