title: Call a Messagebox.Show() from PowerShell with more than default button?
body: <p>I am trying to show a message box from PowerShell with yes and no buttons.</p>
  
  <p>I can display a message box with an OK button:</p>
  
  <pre><code>[system.windows.forms.messagebox]::show("Hello, world!")
  </code></pre>
  
  <p>And I can create a variable $buttons with the buttons I want:</p>
  
  <pre><code>$buttons=[system.windows.forms.messageboxbuttons].yesno
  </code></pre>
  
  <p>And I can see that the Show() static method is overloaded and that one of the options is to give three parameters:</p>
  
  <p><strong><em>Show(String, String, MessageBoxButtons)  Displays a message box with specified text, caption, and buttons.</em></strong></p>
  
  <p>So naturally(?) I decided to call this:</p>
  
  <pre><code>[system.windows.forms.messagebox]::show("Are you sure?","",$buttons)
  </code></pre>
  
  <p>And this results in an error:</p>
  
  <p><strong><em>Cannot find an overload for "Show" and the argument count: "3".</em></strong></p>
  
  <p>But there IS an overload for "Show" that accepts three arguments!</p>
  
  <p>What am I doing wrong?</p>
  
  <p>(And can someone tell me why calling a method in PowerShell is usually done by using the dot syntax: object.method() but requires "::" for the MessageBox class? It's confusing.)</p>