For whatever reason, the -Wait parameter is not working within my powershell runbook. I am perplexed as to why this wouldn't work. I assuming it is a newbie mistake. Any thoughts? Full error and code below:
Error: "Start-AzureRmAutomationRunbook : A parameter cannot be found that matches parameter name 'Wait'. At restore_DEV_DBIN_master_runbook:31 char: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
}
}