Is it possible using the System.Windows.Forms.TextBox (or any other method) to enter in text that can then be converted to securestring? I would like to be able to take a value entered, convert it to securestring and write that to a file which could then be called on if needed and the securestring converted back should we need to identify the value.
I've looked into something similar to this, but since I am using the TextBox forms, I don't want to rely on Read-Host
$secstr = Read-Host -AsSecureString "Enter your text"
$secstr | ConvertFrom-SecureString | out-file C:\temp\test.txt
$secstr = get-content c:\temp\test.txt | ConvertTo-SecureString -AsPlaintText -Force
Essentially, I want to have a text box use masked/password characters (which I can do with $TextBox.PasswordChar = "*" and then take that input and dump it into a securestring text file. Then, I could use another script to call on that file and display the text in plain text for the end user should they need to know that current value.