powershell icon indicating copy to clipboard operation
powershell copied to clipboard

Remove-PnPSiteGroup should have a -Force parameter instead of -Confirm

Open martinlingstuyl opened this issue 2 years ago • 3 comments

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?

martinlingstuyl avatar Oct 18 '23 12:10 martinlingstuyl

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)?

KoenZomers avatar Nov 08 '23 01:11 KoenZomers

Well I believe Remove-PnPSiteGroup did. 😊 I tried that commandlet and got those results from there.

martinlingstuyl avatar Nov 08 '23 06:11 martinlingstuyl

If you check the code you'll see a difference:

ShouldProcess() VS ShouldContinue() and the use (or not) of a Force parameter.

martinlingstuyl avatar Nov 08 '23 06:11 martinlingstuyl