如何解决Start-AzAutomationRunbook不断失败,并显示“ Start-AzureRmAutomationRunbook:找不到与参数名称'Wait'相匹配的参数”
由于某种原因,-Wait参数在我的Powershell Runbook中不起作用。我困惑为什么这行不通。我认为这是一个新手错误。有什么想法吗?以下是完整的错误和代码:
错误: “ Start-AzureRmAutomationRunbook:找不到与参数名称“ Wait”匹配的参数。 在restore_DEV_DBIN_master_runbook上:31个字符:31个 + + CategoryInfo:InvalidArgument:(:) [Start-AzureRmAutomationRunbook],ParameterBindingException + FullyQualifiedErrorId: NamedParameterNotFound,Microsoft.Azure.Commands.Automation.Cmdlet.StartAzureAutomationRunbook “
workflow restore_DEV_DBIN_master_runbook
{
#Establishing Connection
$connectionName = "AzureRunAsConnection"
try {
# Getting the service principal connection "AzureRunAsConnection"
$servicePrincipalConnection = Get-AutomationConnection -name $connectionName
"Logging into Azure..."
Add-AzureRmAccount -ServicePrincipal -TenantID $servicePrincipalConnection.TenantID -ApplicationID $servicePrincipalConnection.ApplicationID -CertificateThumbprint $servicePrincipalConnection.CertificateThumbprint
}
catch {
if (!$servicePrincipalConnection) {
$ErrorMessage = "Connection $connectionName not found."
throw $ErrorMessage
}
else {
Write-Error -Message $_.Exception
throw $_.Exception
}
}
if ($err) {
throw $err
}
inlinescript
{
Start-AzureRmAutomationRunbook –AutomationAccountName 'sqlAutomation' –Name 'scale_down_DEV_DBIN_temp_db' -ResourceGroupName 'sql-Automation-rg' -Wait
}
}
解决方法
找出解决方案。我的模块过期了。更新后,所有内容都像魅力一样。
但是,更新并非易事。如果您实际上单击了更新图标,它会告诉您该功能已被取消,您必须下载ps1文件,然后将其导入到运行簿中。从那里开始运行并不难,只需几个额外的步骤即可。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。