How it works...
Parameter sets have been created so that two incompatible actions are not called for by a cmdlet. However, some parameters can or must be part of multiple parameter sets (for example, the phone number).
To define these parameters, we must begin with CmdletBinding, right after defining the function. On this line, we mention the default parameter set name. This helps when using positional and/or mandatory parameters. Next, when defining the parameters, we specify the parameter set that each of the parameters belongs to. If a parameter belongs to more than one parameter set, we specify all of the parameter sets on separate lines (in our case, the PhoneNumber parameter).
When you run the Get-Help cmdlet for the new wrapper function ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access