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))
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)