title: Powershell Script not working using Import-Clixml command
body: <p>I had a script that was working in Powershell 4.0 in Windows Server 2012 R2.
  Now I installed Windows Server 2016 and I have Powershell V5.1.17134.590.</p>
  
  <p>In my script I have this:</p>
  
  <pre><code>$credFile = "c:\Program Files\Scripts\MyCredentials.xml"
  $credentials = Import-Clixml $credFile
  
  return $credentials
  </code></pre>
  
  <p>This is my MyCredentials.xml:</p>
  
  <pre><code>&lt;Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"&gt;
    &lt;Obj RefId="0"&gt;
      &lt;TN RefId="0"&gt;
        &lt;T&gt;System.Management.Automation.PSCredential&lt;/T&gt;
        &lt;T&gt;System.Object&lt;/T&gt;
      &lt;/TN&gt;
      &lt;ToString&gt;System.Management.Automation.PSCredential&lt;/ToString&gt;
      &lt;Props&gt;
        &lt;S N="UserName"&gt;corp\tfsservice&lt;/S&gt;
        &lt;SS N="Password"&gt;01000000d08c9ddf0115d1118c7a00c04fc297eb01000000f64c30e2720cc64c970ed0d8972b88400000000002000000000003660000c000000010000000bd0a6bf0e5025f1ae6ba8d5b9637db0400000000048&lt;/SS&gt;
      &lt;/Props&gt;
    &lt;/Obj&gt;
  &lt;/Objs&gt;
  </code></pre>
  
  <p>Now I am confused because in my old machine (windows server 2012 R2) when I run the script I got this:</p>
  
  <p><a href="https://i.stack.imgur.com/34dsR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/34dsR.png" alt="enter image description here"></a></p>
  
  <p>As you can see the command is run with success.</p>
  
  <p>However in my Windows Server 2016 machine when I run the same script i get this:</p>
  
  <p><a href="https://i.stack.imgur.com/L3Bja.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L3Bja.png" alt="enter image description here"></a></p>
  
  <p>I don't understand why is this not working now.</p>
  
  <p>Can anyone help me?</p>