How to create a instance of PSCredential that has no password? (Without manually filling out a Get-Credential
dialog with no password, this is for unattended ru
Solution:
$mycreds = New-Object System.Management.Automation.PSCredential
("username", (new-object System.Security.SecureString))
Use the Get-Credential cmdlet, when the credential dialog appears, don't type a password
$cred = Get-Credential pebrian27
$cred.GetNetworkCredential() | select UserName,Password
UserName Password
-------- --------
pebrian27