title: Register-AzAutomationScheduledRunbook giving an error at Powers-shell script
body: <p>I am new to power-shell and cmldt.</p>
  <p>I registered a power-shell script(.ps1) name like &quot;Invoke-xxDevopDt&quot; as azure RunBooks that  associated with an azure Automation Account.This RunBooks scheduled to run at another data for do some work. Below is my power-shell script(.ps1) which i used to register &quot;Invoke-xxDevopDt&quot; (RunBook) by using 'Register-AzAutomationScheduledRunbook' as below</p>
  <pre><code>param ( 
      [Parameter(Mandatory = $false)]
      [string]$resourceGroup='rsgrp_test',
  
      [Parameter(Mandatory = $false)]
      [string]$automationAccountName='Azureaucnt-test',
  
      [Parameter(Mandatory = $false)]
      [datetime]$startDateTime='01/05/2021 6:00:00 PM' ,
      
      [Parameter(Mandatory = $false)]
      [string]$vmResourceIds='/subscriptions/5454-7d8e-xxx-b628-yy3232/resourceGroups/TSTDEV/providers/Microsoft.Compute/virtualMachines/TSTDevVM',
  
      [Parameter(Mandatory = $false)]
      [String] $IncludedKBs='4588962',
  
      [Parameter(Mandatory = $false)]
      [datetime] $vmRestartDateTime='01/06/2021 4:00:00 PM',
  
      [Parameter(Mandatory = $false)]
      [String] $description = &quot;Automated trigger from C# Program&quot;
  
  )
      #do Login-AzAccount  to login azure subcription  
      ....    
      #setting data for   
      $AddMinutes = 7
      
      # creating an scheduling and registering 
      $scheduleName = &quot;testAPP_devopsSchedule_&quot; + &quot;$(Get-Date $vmRestartDateTime -UFormat %Y-%m-%d_%A_%H-%M)&quot;
      $devopsSchedule = New-AzAutomationSchedule -ResourceGroupName $resourceGroup `
                                                        -AutomationAccountName $automationAccountName `
                                                        -Name $scheduleName `
                                                        -StartTime ($vmRestartDateTime.AddMinutes($AddMinutes)) `
                                                        -Onetime -Verbose
                                                        
      #Createing a param for registering another PS-script as RunBook with automation-acnt
      $params = @{&quot;serverList&quot;=$vmResourceIds;&quot;testMessage&quot;=&quot;test&quot;;&quot;description&quot;=&quot;Invoking Automation from Automation Account&quot;}
      #register 'Invoke-xxDevopDt' is like a ps-script at runBook of automation-acnt
      Register-AzAutomationScheduledRunbook –AutomationAccountName $automationAccountName `
                          –Name 'Invoke-xxDevopDt' –ScheduleName $devopsSchedule.Name –Parameters $params `
                          -ResourceGroupName $resourceGroup
  </code></pre>
  <p>But, above ps-script gave an ERROR as &quot;<strong>Register-AzAutomationScheduledRunbook : A positional parameter cannot be found that accepts argument 'Invoke-xxDevopDt'</strong>.&quot;</p>
  <p>Pls help</p>
  <p>Thanks,</p>