title: Invoke-Command error "Parameter set cannot be resolved using the specified named parameters"
body: <p>Hope you can help me with a problem trying to execute a script block with alternate credentials on a local computer. I've been thoroughly searching on forums and doing some googling and found two possible approach to solve my problem:</p>
  
  <ol>
  <li>Use Invoke-Command</li>
  <li>Use Start-Job</li>
  </ol>
  
  <p>Using approach #1 I had this code:</p>
  
  <pre><code>$res = Invoke-Command -Credential $migratorCreds -ScriptBlock {param($one, $two) Get-LocalUsers -parentNodeXML $one -migratorUser $two } -ArgumentList $xmlPRE,$migratorCreds
  </code></pre>
  
  <p>where <code>Get-LocalUsers</code> is a custom function stored in a custom module (*.psm1).</p>
  
  <p>My problem is that every time I run this code I get following error:</p>
  
  <blockquote>
    <p>Parameter set cannot be resolved using the specified named parameters</p>
  </blockquote>
  
  <p>So it's obvious that I must be missing something, could you help me on this topic?</p>
  
  <p>Thanks in advance...</p>