ShouldContinue
The ShouldContinue method is also made available when the SupportsShouldProcess property is set in CmdletBinding.
ShouldContinue differs from ShouldProcess in that it always prompts. This technique is used by commands such as Remove-Item to force a prompt when the Recurse parameter is not present and a directory name is passed.
ShouldContinue is rarely necessary, since ShouldProcess is the better option. It is available for the cases where a function must have a confirmation prompt that cannot be bypassed. Using ShouldContinue may make it impossible to run a function without user interaction unless also providing a means to bypass the prompt.
The use of ShouldContinue is similar to ShouldProcess. The most significant difference ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access