Skip to content

Instantly share code, notes, and snippets.

@booyaa
Created March 17, 2014 15:45
Show Gist options
  • Save booyaa/9601734 to your computer and use it in GitHub Desktop.
Save booyaa/9601734 to your computer and use it in GitHub Desktop.
Powershell Magick

###password input

user feedback will be stars instead of password

$secret = Read-Host 'Enter a secret: ' -AsSecureString
$notSoSecret = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($secret))
Write-Host $notSoSecret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment