title: Powershell TextBox SecureString
body: <p>Is it possible using the <code>System.Windows.Forms.TextBox</code> (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.</p>
  
  <p>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</p>
  
  <pre><code>$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
  </code></pre>
  
  <p>Essentially, I want to have a text box use masked/password characters (which I can do with <code>$TextBox.PasswordChar = "*"</code> 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.</p>