title: Setting up multiple parameter sets
body: <p>I am working on a function that contains multiple parameter sets with some being mandatory.</p>
  
  <p>i want the sets to be setup in a particular way but no combination I setup seems to be working correctly.</p>
  
  <p>Function Requirements:</p>
  
  <ul>
  <li>Function can use either <code>$OrganizationName</code>, <code>$IsUserRepo</code> or neither</li>
  <li>Function must use either <code>$AllEvents</code> or, one or more from a list of CustomEvents. Default is <code>$AllEvents</code></li>
  </ul>
  
  <p>Examples of what I want to be able to call:</p>
  
  <pre><code>Test-Function -RepoName 'name' -WebHookURL 'https://something.com' -AllEvents
  Test-Function -RepoName 'name' -OrganizationName 'OrgName' -WebHookURL 'https://something.com' -AllEvents
  Test-Function -RepoName 'name' -IsUserRepo -WebHookURL 'https://something.com' -AllEvents
  Test-Function -RepoName 'name' -WebHookURL 'https://something.com' -CommitComment -Create (ect...)
  Test-Function -RepoName 'name' -OrganizationName 'OrgName' -WebHookURL 'https://something.com'  -CommitComment -Create (ect...)
  Test-Function -RepoName 'name' -IsUserRepo -WebHookURL 'https://something.com'  -CommitComment -Create -Delete (ect...)
  </code></pre>
  
  <p>Parameters I've been testing with:</p>
  
  <pre><code>Function Test-Function {
    [CmdletBinding(
      SupportsShouldProcess = $true,
      DefaultParameterSetName = 'OrganizationRepo'
    )]
    param(
      [Parameter(
        Position = 0,
        Mandatory = $true,
        ValueFromPipelineByPropertyName = $true,
        HelpMessage = "Enter the name of the repository")]
      [ValidateNotNullOrEmpty()]
      [string]
      $RepoName,
  
      [Parameter(
        ParameterSetName = "OrganizationRepo",
        Position = 1,
        ValueFromPipelineByPropertyName = $true,
        HelpMessage = "Enter the name of the organization account where the repository exists. Default: PowerShell. Ex: Windows-Server-Engineering")]
      [string]
      $OrganizationName = 'POWERSHELL',
  
      [Parameter(
        ParameterSetName = "IsUserRepo",
        Position = 1,
        ValueFromPipelineByPropertyName = $true,
        HelpMessage = "Repository exists under your personal GitHub account. Default: False")]
      [switch]
      $IsUserRepo,
  
      [Parameter(
        Mandatory = $true,
        ValueFromPipelineByPropertyName = $true,
        HelpMessage = "Enter the URL to which the payloads will be delivered")]
      [string]
      $WebHookURL,
  
      [Parameter(ParameterSetName = "OrganizationRepo")]
      [Parameter(ParameterSetName = "IsUserRepo")]
      [Parameter(ParameterSetName = 'AllEvents',
        ValueFromPipelineByPropertyName = $true,
        HelpMessage = "All Events. Default: False")]
      [Switch]
      $AllEvents,
  
      [Parameter(ParameterSetName = "OrganizationRepo")]
      [Parameter(ParameterSetName = "IsUserRepo")]
      [Parameter(ParameterSetName = 'CustomEvents',
        ValueFromPipelineByPropertyName = $true,
        HelpMessage = "Any time a Commit is commented on. Default: False")]
      [Switch]
      $CommitComment,
  
      [Parameter(ParameterSetName = "OrganizationRepo")]
      [Parameter(ParameterSetName = "IsUserRepo")]
      [Parameter(ParameterSetName = 'CustomEvents',
        ValueFromPipelineByPropertyName = $true,
        HelpMessage = "Any time a Branch or Tag is created. Default: False")]
      [Switch]
      $Create
    )
    # Continuing Custom Event Parameters
  }
  </code></pre>