Consider these parameters:
[parameter(Mandatory = $true)]
[string[]]$UserId,
[parameter(Mandatory = $true)]
[string[]]$EmployeeId,
[parameter(Mandatory = $true)]
[string[]]$GroupId,
[parameter(Mandatory = $true)]
[string[]]$GroupName
- UserId & EmployeeId are mutually exclusive
- GroupId & GroupName are mutually exclusive
All of them are mandatory; read: At least one of, UserId or EmployeeId; At least one of, GroupId or GroupName.
Another way to look at it; A & B are mutually exclusive; C & D are mutually exclusive
- A - UserId
- B - EmployeeId
- C - GroupId
- D - GroupName
Possible Combinations I want:
AC
AD
BC
BD
I have tried to use multiple parameter sets to accomplish this but I am clearly not doing something correctly. I can't seem to work out the correct combination of parameter sets. I did see several example posts on this topic and tried to apply it to this use case; I was not successful.