Start-AzAutomationRunbook 不断失败,并显示“未指定 Runbook 强制参数”。参数名称 ResourceGroupName。

用户1951756

我正在尝试使用 powershell 启动自动化运行手册,但该命令一直失败并出现以下错误...

Start-AzAutomationRunbook : Runbook mandatory parameter not specified. Parameter name ResourceGroupName.

这是我正在运行的命令...

Start-AzAutomationRunbook -AutomationAccountName "existingAccountName" -Name "existingRB" -ResourceGroupName "existingRG" -MaxWaitSeconds 2000 -Wait

我已经确认自动化帐户存在,资源组存在,运行手册存在。我已经在控制台中成功启动了 Runbook,没有出现错误。

我希望在 Powershell 中运行 Start-AzAutomationRunbook 时启动 Runbook。

贸易

看来您的作业脚本需要一个resourcegroupname参数才能运行。您在下面一行中指定的资源组是运行手册所在帐户的资源组。

Start-AzAutomationRunbook -AutomationAccountName "existingAccountName" -Name "existingRB" -ResourceGroupName "existingRG" -MaxWaitSeconds 2000 -Wait

要将资源组或参数应用于实际作业,您必须传递参数,如果您的作业只需要 ResourceGroupName,则下面应该可以工作。

$AutomationRG = "existingRG"

$params = @{"ResourceGroupName"="$AutomationRG"}

Start-AzureRmAutomationRunbook -AutomationAccountName "existingAccountName" -Name "existingRB" -ResourceGroupName $AutomationRG -Parameters $params

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

Related 相关文章

热门标签

归档