I want to add two switch parameters to my custom PowerShell cmdlet like this:
[Parameter(Mandatory = false, ParameterSetName = "p1")]
public SwitchParameter switchOne { get; set; }
[Parameter(Mandatory = false, ParameterSetName = "p2")]
public SwitchParameter switchTwo { get; set; }
But when I run my cmdlet, it raises AmbiguousParameterSet, even if I don't specify any of them. Am I missing something here?
Cmdletattribute?[Cmdlet(DefaultParameterSet = "p1")]Cmdletattribute, but notCmdletBindingattribute.