-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-sdk-refArea - SDK .NET APIArea - SDK .NET API
Description
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:
-
- Operations with ConfirmImpact equal to or greater than $ConfirmPreference are confirmed
IF ConfirmImpact >= ConfirmPreference THEN prompt
- Also:
- Operations with ConfirmImpact.None are never confirmed
- no operations are confirmed when $ConfirmPreference is ConfirmImpact.None (except when explicitly requested with -Confirm).
-
- When the value of the $ConfirmPreference variable is less than or equal to the risk assigned to a cmdlet or function, PowerShell automatically prompts you for confirmation before running the cmdlet or function.
IF ConfirmPreference <= ConfirmImpact THEN prompt
IF ConfirmImpact > ConfirmPreference THEN prompt
-
- The call to the ShouldProcess method displays a confirmation prompt only when the ConfirmImpact argument is equal to or greater than the value of the $ConfirmPreference preference variable.
IF ConfirmImpact >= ConfirmPreference THEN prompt
-
- 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 ConfirmPreference >= ConfirmImpact THEN prompt
IF ConfirmImpact < ConfirmPreference THEN prompt
-
IF ((threshold == ConfirmImpact.None) || (threshold > cmdletConfirmImpact)) THEN autoconfirm
- =>
IF ConfirmPreference <= ConfirmImpact THEN prompt
IF ConfirmImpact > ConfirmPreference THEN prompt
Page URL
Content source URL
Author
Document Id
52e61b94-396a-b5aa-5b39-b79a0e74a8d3
Metadata
Metadata
Assignees
Labels
area-sdk-refArea - SDK .NET APIArea - SDK .NET API