Skip to content

Review of ConfirmImpact/ConfirmPreference comparison #11419

@jikuja

Description

@jikuja

Type of issue

Other (describe below)

Feedback

If Confirm parameter is not used, the ShouldProcess() call requests confirmation if the $ConfirmPreference preference variable is equal to or greater than the ConfirmImpact setting of the cmdlet or provider.

If I understood other sources correctly the comparison is being inverted here.

There should be larger rewiew and update if the logic is

IF ConfirmImpact >= ConfirmPreference 
THEN prompt

or

IF ConfirmImpact > ConfirmPreference 
THEN prompt

Other sources / analysis:

Page URL

https://learn.microsoft.com/en-us/powershell/scripting/developer/cmdlet/users-requesting-confirmation?view=powershell-7.4

Content source URL

https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/docs-conceptual/developer/cmdlet/users-requesting-confirmation.md

Author

@sdwheeler

Document Id

52e61b94-396a-b5aa-5b39-b79a0e74a8d3

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions