title: New-WebServiceProxy Authentification fails when username contains a '@' character
body: <p>I'm trying to create a proxy to a SOAP service using the <a href="http://go.microsoft.com/fwlink/?LinkID=135238" rel="nofollow">New-WebServiceProxy cmdlet</a> with a username containing a <code>@</code>character:</p>
  
  <pre><code>$webAddr = 'https://MYSERVER?wsdl'
  $secpasswd = ConvertTo-SecureString "MYPASSWORD" -AsPlainText -Force
  $mycreds = New-Object System.Management.Automation.PSCredential ("USER@NAME", $secpasswd)
  
  [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
  $proxy = New-WebServiceProxy -Uri $webAddr -Credential $mycreds
  </code></pre>
  
  <p>Somehow, this doesn't work and I receive the following error:</p>
  
  <blockquote>
    <p>New-WebServiceProxy : The request failed with HTTP status 401:
    Authentification failed!.</p>
  </blockquote>
  
  <p>When I use the same code with a username without an '@' character, the proxy gets created and is working fine. I'm also able to connect to the server with the username containing the <code>@</code> character with <code>C#</code> when I add the service reference in Visual Studio or by using a browser.</p>
  
  <p>I already tried to escape the username using <code>System.Uri.EscapeUriString()</code> and <code>System.Web.HttpUtility.UrlPathEncode()</code>without success.</p>
  
  <p>Any ideas?</p>