** Pastebin PRO Accounts Winter Special ** Get 40% discount for a limited time only! Click Here to check it out ;-)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: 228  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
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