Skip to content

Instantly share code, notes, and snippets.

@janbaer
Created June 26, 2013 08:53
Show Gist options
  • Save janbaer/5865861 to your computer and use it in GitHub Desktop.
Save janbaer/5865861 to your computer and use it in GitHub Desktop.
Request a password with a masked password-dialog in powershell
$securestring = Read-Host -AsSecureString "Please enter your password"
$password = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($securestring))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment