Using Powershell 5.1 runbook.
I'm trying to test sending an email from another runbook. The SendEmailToDba runbook runs successfully given the same parameters as I'm using in this second runbook. I cant figure out why it is complaining about the "ResourceGroupName" parameter. It is a required parameter of Start-AzureAutomationRunbook.
$params = @{ "destEmailAddress" = "me@company.com"; "fromEmailAddress" = "me@company.com"; "subject" = "test Email from Runbook"; "content" = "This is a test from another runbook" }
Write-Output( $params )
$job = Start-AzureAutomationRunbook `
-Name "SendEmailToDba" `
-Parameters $params `
-AutomationAccountName "myAccount" `
-ResourceGroupName "my-automation-resourcegroup"
Then I get the following error:
System.Management.Automation.ParameterBindingException: A parameter cannot be found that matches parameter name 'ResourceGroupName'.
at System.Management.Automation.CmdletParameterBinderController.VerifyArgumentsProcessed(ParameterBindingException originalBindingException)
at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoValidation(Collection1 arguments) at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection
1 arguments)
at System.Management.Automation.CommandProcessor.BindCommandLineParameters()
at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary psDefaultParameterValues)
at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)