Basically let’s say I’d like to set $Option to mandatory but only if $mode=“Option2”. Obviously I can do this easily enough in the script outside of the param block, but I figured I’d ask if there was a more elegant way?
Nope. You’ll have to add that validation logic inside the function somewhere. (Usually in the Begin block, but might need to be in Process if either of those parameters can accept pipeline input.)