ICommandRuntime.ShouldProcess Method (String, String, String)
Assembly: System.Management.Automation (in System.Management.Automation.dll)
bool ShouldProcess ( string verboseDescription, string verboseWarning, string caption )
function ShouldProcess ( verboseDescription : String, verboseWarning : String, caption : String ) : boolean
A description of the action the cmdlet wants to perform. This is what is displayed to the user for ActionPreference.Continue.
A query that asks whether the action should be performed. This is what is displayed to the user for ActionPreference.Inquire.
The caption to display as part of the prompt (such as the window title in a dialog box).
Return ValueA Boolean value that indicates true if the user wants the cmdlet to continue; false indicates not to continue.
Cmdlets call ShouldProcess before the cmdlet makes a change to the system, such as deleting files or stopping services.
The implementation of this method should take into account command-line settings and preference variables in determining whether it should prompt the user and what it should return.