title: MessageBox is not displayed if it called from a method of a class in PowerShell
body: <p>I have a PowerShell function which works fine if I use a message box to provide some feedback to the user. I want to add the function to a class though. The class method works fine except this line of code:</p>
  
  <pre><code>[system.windows.forms.messagebox]::show("The folder path does contain the right parameters.")
  </code></pre>
  
  <p>It keeps giving me the error:</p>
  
  <pre><code>Unable to find type: [System.Windows.Forms.Messagebox]
  </code></pre>
  
  <p>I have tried everything I could find on the Internet. I created a really simple class as shown below which will display the message box in ISE, but it doesn't show the message box if I run it in a PowerShell window. I just don't have the knowledge to figure out why.</p>
  
  <pre><code>class test {
      [void]ok() {
          Add-Type -AssemblyName "System.Windows.Form"
          [void][System.Windows.Forms.Messagebox]::Show("This works in ISE but not powershell window")
      }
  }
  
  $e = [test]::new()
  $e.ok()
  </code></pre>
  
  <p>I am sure there is a simple answer to this, but I don't know what it is. </p>