"Import-Clixml : SS XML tag is not recognized" when trying to pass credentials into K2000 post-installation script
Here is what I have, and it works in the ISE:
$domain = "company.com"
$credential = Import-Clixml 'SecureCredentials.xml'
add-computer -Credential $credential -DomainName $domain -OUPath $ouPath
shutdown /r /t 000
The error I'm getting when it runs in Kace is:
C:\KACE\Applications\69\powershell.exe -nologo -executionpolicy bypass -noprofile -file ".\join_domain.ps1"
Import-Clixml : SS XML tag is not recognized.
At C:\KACE\Applications\69\join_domain.ps1 :27 char:28
+ $credential = Import-Clixml <<<< 'SecureCredentials.xml'
+ CategoryInfo : NotSpecified: <:> [Import-Clixml], XmlException
+ FullyQualifiedErrorid : System.Xml.XmlException,Microsoft.Powershell.commands.ImportClixmlCommand
Does anyone know why this will work in the ISE but not in the K2000? I'm running version 4.0.695 of the K2000.
Answer Chosen by the Author
Unfortunately, I found out that what I was trying to do by importing this wouldn't work the way I wanted anyway, so that's unfortunate, but at least someone who has this error in the future will find an answer faster than I did. I should have realized the problem sooner.