Skip to content

Instantly share code, notes, and snippets.

@jstrassburg
Created March 3, 2014 18:50
Show Gist options
  • Save jstrassburg/9331851 to your computer and use it in GitHub Desktop.
Save jstrassburg/9331851 to your computer and use it in GitHub Desktop.
Read a password (***) from the console with PowerShell
$password = Read-Host -assecurestring "Please enter the password"
$password = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($password))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment