Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ICommandRuntime.ShouldProcess Method

Requests confirmation from the user before an action is taken. The variants of this method can be used to display the name of the resource to be changed, display the resource name and the action to be taken, and more.

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.

NameDescription
ICommandRuntime.ShouldProcess (String)Requests confirmation with the user by displaying the name of the resource to be changed, provided by the cmdlet, and returning an answer based on the user feedback.
ICommandRuntime.ShouldProcess (String, String)Requests confirmation with the user by displaying the name of the resource to be changed and the action to be taken, provided by the cmdlet, and returning an answer based on the user feedback.
ICommandRuntime.ShouldProcess (String, String, String)Requests confirmation with the user by displaying the action to be taken, a query asking if the cmdlet should continue, a caption for the prompt, and returning an answer based on the user feedback.
ICommandRuntime.ShouldProcess (String, String, String, ShouldProcessReason)Requests confirmation with the user by displaying the action to be taken, a query asking if the cmdlet should continue, a caption for the prompt, and returning an answer based on the user feedback and the reason why false is returned.

Send comments about this topic to Microsoft.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.