title: PowerShell Function Parameter Validation
body: <p>assume I've got a Function Add-Values, how to avoid an ugly error-message, when one gives a string and not an integer for the paramters?</p>
  
  <pre><code>Function Add-Values
  {
      param(
      [parameter(mandatory=$true)][int]$val1,
      [parameter(mandatory=$true)][int]$val2
      )
  
      $val1 + $val2
  }
  </code></pre>
  
  <p>Thank you for the help</p>