title: Powershell C# cmdlet with parametersets with same subset of parameters
body: <p>I have defined the following parameter sets in MyCustomCmdlet with <strong>default parameterset as two</strong>:</p>
  
  <pre><code>    [Parameter(Mandatory = true, ParameterSetName = one)]
      [Parameter(Mandatory = true, ParameterSetName = two)]
      [Parameter(Mandatory = true, ParameterSetName = three)]
      [Parameter(Mandatory = true, ParameterSetName = four)]
      [ValidateNotNullOrEmpty]
      [Alias("a")]
      public string A { get; set; }
  
      [Parameter(Mandatory = true, ParameterSetName = two)]
      [ValidateNotNullOrEmpty]
      [Alias("b")]
      public string B { get; set; }
  
      [Parameter(Mandatory = true, ParameterSetName = three)]
      [SupportsWildcards]
      [ValidateNotNullOrEmpty]
      [Alias("c")]
      public string C { get; set; }
  
  
      [Parameter(Mandatory = true, ParameterSetName = four)]
      [ValidateNotNullOrEmpty]
      [Alias("d")]
      public string D { get; set; }
  
  
      [Parameter]
      [ValidateNotNullOrEmpty]       
      public string E{ get; set; }
  
      [Parameter]
      [ValidateNotNullOrEmpty]
      public string F { get; set; }
  </code></pre>
  
  <p>During debug, am getting expected number of parameter sets i.e. 4 with following parameters:</p>
  
  <p>1.ParameterSetName: one Parameters: A , E, F</p>
  
  <p>2.ParameterSetName: two Parameters: A, B , E, F</p>
  
  <p>3.ParameterSetName: three Parameters: A, C , E, F</p>
  
  <p>4.ParameterSetName: four Parameters: A, D , E, F</p>
  
  <p>However, when I execute:</p>
  
  <blockquote>
    <blockquote>
      <p>MyCustomCmdlet -A or MyCustomCmdlet -A -E -F</p>
    </blockquote>
  </blockquote>
  
  <p>I am getting error stating, requires mandatory parameter B which is part of default parameter set.</p>
  
  <ol>
  <li>Can someone please help me understand this behavior?</li>
  <li>How to execute the cmdlet using parameter set "one"</li>
  </ol>