Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
decrypt a securestring
$p=read-host "password ?" -assecurestring
$Ptr = [System.Runtime.InteropServices.Marshal]::SecureStringToCoTaskMemUnicode($p)
$clearpassword = [System.Runtime.InteropServices.Marshal]::PtrToStringUni($Ptr)
[System.Runtime.InteropServices.Marshal]::ZeroFreeCoTaskMemUnicode($Ptr)
see more here
http://stackoverflow.com/questions/7468389/powershell-decode-system-security-securestring-to-readable-password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.