powershell
powershell copied to clipboard
Remove-PnPSiteGroup should have a -Force parameter instead of -Confirm
Many Remove commandlets of pnp powershell have a -Force parameter to skip the confirmation prompt.
Some however have a -Confirm option that works the other way around, using -Confirm:$false you can skip the confirmation prompt.
Should this be aligned so that it all works the same?
Fair point. I did a quick search in the code and 30-somewhat cmdlets show up that describe supporting -Confirm in their documentation, but after checking 10 of them they don't even seen to support using -Confirm on them. Is this just documentation that is mismatching or did you actually find a cmdlet where a Confirm actually does do something? If so, which one(s)?
Well I believe Remove-PnPSiteGroup did. 😊 I tried that commandlet and got those results from there.
If you check the code you'll see a difference:
ShouldProcess() VS ShouldContinue() and the use (or not) of a Force parameter.