Why does Remove-ADGroupMember default to requiring confirmation?

Solution 1:

Are you asking why not including "-Confirm" prompts you for confirmation? By default, without specifying $false the cmdlet will always prompt for confirmation. The option is there to give you the ability to suppress the confirmation. It may be confusing in that it is called -Confirm but that is because with PS you specify a value for that parameter. So you are in essence saying "set -Confirm to false/no". It would be much more confusing if the parameter were called -NoConfirm and you had to set a value for that parameter!

This is by design. The default is to prompt when you run this cmdlet without the -Confirm:$false to be sure that you wanted to run the command.

Some links for knowledge (note they don't answer the question directly, just give you some insight into PS grammar/syntax):

http://blogs.msdn.com/b/powershell/archive/2006/05/10/594535.aspx

http://www.manning.com/payette/AppCexcerpt.pdf

http://technet.microsoft.com/en-us/magazine/jj554301.aspx

EDIT: maybe I misinterpreted your question. I was basing my answer on "there is a -Confirm option that is supposed to turn on confirmation". If your question is why do I have to use a colon then @DavidV's answer is right on the money.

Solution 2:

A great answer is provided over at Stackoverflow (all credit to manojlds):

https://stackoverflow.com/questions/8525572/powershell-colon-in-commandlet-parameters