Check out the Pastebin Gadgets Shop. We have thousands of fun, geeky & affordable gadgets on sale :-)Want more features on Pastebin? Sign Up, it's FREE!

Retrieve masked password in powershell

By: jamiet on Apr 24th, 2014  |  syntax: Power Shell  |  size: 0.19 KB  |  views: 364  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print  |  QR code  |  clone
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. $response = Read-host "What's your password?" -AsSecureString
  2. $password = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($response))
clone this paste RAW Paste Data