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