Created
July 21, 2018 20:04
-
-
Save turboBasic/ffdd6d7a37221b754adba103cb294157 to your computer and use it in GitHub Desktop.
[Get-DecryptedSecureString] :: Decrypts secure strings eg. from [System.Management.Automation.PSCredential], Get-Credential etc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-DecryptedSecureString( [System.Security.SecureString] $secureString ) | |
{ | |
return [System.Runtime.InteropServices.Marshal]::PtrToStringUni( | |
[System.Runtime.InteropServices.Marshal]::SecureStringToCoTaskMemUnicode( | |
$secureString | |
)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment