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
Get-Credential
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