title: A positional parameter cannot be found that accepts argument 'System.Management.Automation.PSCredential'
body: <p>I'm try running a DSC configuration in azure automations, but it get's suspended with following exception: </p>
  
  <blockquote>
    <p>"The running command stopped because the preference variable
    "ErrorActionPreference" or common parameter is set to Stop: A
    positional parameter cannot be found that accepts argument
    'System.Management.Automation.PSCredential'.</p>
  </blockquote>
  
  <p>The code I'm running is :</p>
  
  <pre><code>Configuration DomainJoin{
  
  $cred = Get-AutomationPSCredential -Name "azurelogin" 
  Login-AzureRmAccount $cred
  Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
  Import-DscResource -ModuleName 'xDSCDomainjoin'
  $dscDomainAdmin = Get-AzureRmAutomationCredential -Name "GSY admin" -ResourceGroupName "RG-DC-ROCS" -AutomationAccountName "RocsAutomation"
  $dscDomainName = Get-AzureRMAutomationVariable -Name "dscDomainName" -ResourceGroupName "RG-DC-ROCS" -AutomationAccountName "RocsAutomation"
  #PSDscAllowDomainUser = $True
  
  node localhost
  {
      xDSCDomainjoin JoinDomain
      {
          Domain = $dscDomainName
          Credential = $dscDomainAdmin
      }
  }
  }
  </code></pre>
  
  <p>Any idea how I can solve the exception?</p>