title: Powershell Salesforce SOAP API SessionHeader Type Converion Issue
body: <p>Hi I am having trouble setting the SessionHeaderValue. I am basing my code on c#.Net. The login works and I receive the serviceUrl and sessionId in the login result but I can't get the session Id set in the session header</p>
  
  <p>Here is the code</p>
  
  <pre><code>$uri = "c:\installs\sforce.wsdl"
  $username = "username"
  $password = "password"
  # Proxy
  $service = New-WebServiceProxy -Uri $uri -Namespace sforce -UseDefaultCredential
  # Login
  $loginResult = $service.login($username, $password)
  $service.Url = $loginResult.serverUrl
  $service.SessionHeaderValue = New-Object sforce.SessionHeader
  </code></pre>
  
  <p>This is the error I get which is a bit odd.</p>
  
  <p>Exception setting "SessionHeaderValue": "Cannot convert the "sforce.SessionHeader" value of type "sforce.SessionHeader" to type "sforce.SessionHeader"."</p>
  
  <p>I have been playing with this for a few hours now and have run out of ideas.</p>
  
  <p>Any help is appreciated.</p>
  
  <p>Anthony</p>