In a script, I need to manage the membership of a group. Unfortunately, the cmdlet for removing a member from a group,
Remove-ADGroupMember is always asking for confirmation. This is contradictory to the described behavior of the cmdlet, as there is a
-Confirm option that is supposed to turn on confirmation. This requires using obscure and poorly documented colon binding of a value to a switch parameter:
-Confirm:$false, when it would make much more sense to instead use a straightforward
Is there a setting in the environment that is changing how the cmdlet behaves? Is this just a poorly implemented feature? Am I missing some obvious documentation that would explain the confusing behavior of switch parameters?