How to create secure string and how to get back plaintext from secure string

$SecString = Read-Host „Put Password String“ -AsSecureString
$GetBackPlainText = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecString)
$PlainText = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($GetBackPlainText)

images