Question:
Is it possible to convert NetworkCredentials (or a variant) to a PSCredential?
I want to transparently use the credentials of the current user, but don’t want to prompt them.
Answer:
1 2 |
$cred = new-object PSCredential($nc.UserName, (ConvertTo-SecureString $nc.Password -AsPlainText -Force)) |