title: How to use a default value with parameter sets in PowerShell?
body: <p>I have this function</p>
  
  <pre><code>Function Do-ThisOrThat
  {
  [cmdletbinding()]
  param (
      [Parameter(Mandatory = $false, ParameterSetName="First")]
      [string]$FirstParam = "MyFirstParam",
  
      [Parameter(Mandatory = $false, ParameterSetName="Second")]
      [string]$SecondParam
      )
      Write-Output "Firstparam: $FirstParam. SecondParam $SecondParam"
  }
  </code></pre>
  
  <p>If I call the function like this <code>Do-ThisOrThat</code> I want it to detect that the $FirstParam has a default value and use that. Is it possible? Running it as is only works if I specify a parameter.</p>
  
  <p>e.g. this works: <code>Do-ThisOrThat -FirstParam "Hello"</code></p>