title: Making a powershell form button call to a function
body: <p>Im trying to build a gui form using powershell, i want to add a button</p>
  
  <pre><code>$Button = New-Object System.Windows.Forms.Button
  $Button.Location = New-Object System.Drawing.Size(35,35)
  $Button.Size = New-Object System.Drawing.Size(120,23)
  $Button.Text = "Show Dialog Box"
  $Form.Controls.Add($Button)
  $Button.Add_Click($Button_Click)
  </code></pre>
  
  <p>now i want to create a function called button_click with a few commands, lets say: echo "Hello world"
  so i write this:</p>
  
  <pre><code>Function Button_Click(){
  echo "Hello World"}
  </code></pre>
  
  <p>But clicking on the button wont give me any result, what am i doing wrong here?</p>