Created
June 11, 2019 02:21
-
-
Save 45413/a7dee1c67b914ba941f29502a824a002 to your computer and use it in GitHub Desktop.
Convert SecureString to String
This file contains 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 Convert-SecureString { | |
[CmdletBinding()] | |
param ( | |
# SecureString | |
[Parameter(Mandatory=$true)] | |
[SecureString] | |
$SecureString | |
) | |
Return ( [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString)) ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment