PowerShell: convert password to secure string for RDP connection file

encrypt:

("Password!" | ConvertTo-SecureString -AsPlainText -Force) | ConvertFrom-SecureString

decrypt:

$s = ConvertTo-SecureString "encoded string"
$pointer = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($s)
$password = [Runtime.InteropServices.Marshal]::PtrToStringAuto($pointer)
$password