# Prompt for a Secure String (in automation, just accept it as a parameter)
$Secure = Read-Host -Prompt "Enter the Secure String" -AsSecureString
# Encrypt to Standard String and store on disk
ConvertFrom-SecureString -SecureString $Secure | Out-File -Path "${Env:AppData}\Sec.bin"
# Read the Standard String from disk and convert to a SecureString
$Secure = Get-Content -Path "${Env:AppData}\Sec.bin" | ConvertTo-SecureString