Advertisement
jamiet

Retrieve masked password in powershell

Apr 24th, 2014
1,754
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $response = Read-host "What's your password?" -AsSecureString
  2. $password = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($response))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement