Experience Matters !!!
Sunday, 5 February 2017
SecureString in PowerShell
If you want to read secure string from a prompt, do the following:
$mySecureString = Read-Host 'Enter the string' -AsSecureString
To convert the SecureString to string, do the following:
$string= [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($mySecureStrring))
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment