Now, if the value of the preference variable$confirmPreference is lower than that of a command, the command requires the user to confirm the required action.
I try to demonstrate that in the following example. By default, the value of $confirmPreference is High:
PS C:\> $confirmPreference
High
Because the value of ConfirmImpact of stop-process is Medium only, I can use stop-process without being asked for confirmation:
However, If I set the value of $confirmPreference to Medium, I will be asked to confirm the killing of a process:
PS C:\> start-process notepad
PS C:\> $confirmPreference = 'medium'
PS C:\> stop-process -name notepad
Confirm
Are you sure you want to perform this action?
Performing the operation "Stop-Process" on target "notepad (37468)".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):