2014-09-11 01:48 PM
Yes, try this.
read-host -assecurestring | convertfrom-securestring | out-file C:\securestring.txt`
Once you have the encrypted password file created, you can add the following to your script or run direct from the CLI:
$username = "domain01\user"
$password = cat C:\securestring.txt | convertto-securestring
$cred = new-object -typename System.Management.Automation.PSCredential `
-argumentlist $username, $password
Then, connect-nacontroller controller01 -Credential $cred