I have the following parameter input and three choices the user can type:
Param( [Parameter(Mandatory=$true)] [ValidateSet('View','Add','Remove')] [String]$Command, [Parameter(Mandatory=$false)] [String]$UserID )
How can I make it so that it’s mandatory to enter
$Command is either “Add” or “Remove”, while not mandatory if “View” is the command?
I know there is dynamic parameters…but if there is an easier way to do this its even better
otherwise, how would i do it with dynamicparam?