Forum Discussion
Apr 21, 2014
I think your problem is with the Get-Credential call. That will return a PSCredential object with UserName (String) and Password (SecureString) members. You are treating the SecureString as a regular string when passing that in. Odds are the error occurs there. Try converting the password into a clear text string before calling initialize.
$creds = Get-Credential;
$user = $creds.Username;
$pass = $creds.GetNetworkCredential().Password;
Here's an article on dissecting the SecureString
Hope this helps...
-Joe