Here is an example. Please dont use this key

its from the help file
$PasswordforFile = Read-Host -AsSecureString
$key = (3,4,2,3,56,34,254,222,1,1,2,23,42,54,33,233,1,34,2,7,6,5,35,43)
ConvertFrom-SecureString -SecureString $PasswordforFile -key $key | out-file C:\temp\SecurePasswordfile
$SecureTextFromFile = Get-Content C:\temp\SecurePasswordfile
$password = ConvertTO-SecureString $SecureTextFromFile -key $key
# to see what you wrote use this function
function GetSecurePass ($SecurePassword) {
$Ptr = [System.Runtime.InteropServices.Marshal]::SecureStringToCoTaskMemUnicode($SecurePassword)
$password = [System.Runtime.InteropServices.Marshal]:

trToStringUni($Ptr)
[System.Runtime.InteropServices.Marshal]::ZeroFreeCoTaskMemUnicode($Ptr)
$password
}
GetSecurePass $password