title: How to close a powershell gui windows form after the button is clicked?
body: <p>i have a script which created a small windows gui form with buttons depending on the scenarios;</p>
  
  <p>-> on clicking, these buttons open respective files on remote file shares;following is the code;</p>
  
  <pre><code>$run.Add_Click({Invoke-Expression "Powershell \\Fileshare\$Random_File.Doc"}.GetNewClosure())
  </code></pre>
  
  <p>-> my issue is eventhough after the click the file opens ; the form still hangs arround in the back ground; I want to know how to close it(and even better if i can close whole powershell too)  ; i tried to embed ";exit" inside invoke but it gave errors , is there any other way to do it? </p>
  
  <p>Please ask me if any questions or clarifications required.</p>