title: PSCredential Overload Error
body: <p>In powershell I want to use the username and password which are stored in $uname, $pass. These are actually read from a file and is stored in $uname and $pass, each time the script executes. I have tried like</p>
  
  <pre><code>$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $uname,$pass
  </code></pre>
  
  <p>But the error is</p>
  
  <pre><code>new-object : Cannot find an overload for "PSCredential" and the argument count: "2".
  </code></pre>
  
  <p>I need to use these credentials for a New-PsSession later on in the script. Can someone please help at the earliest?</p>