Export (0) Print
Expand All

ICommandRuntime.ShouldProcess Method (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.

Namespace: System.Management.Automation
Assembly: System.Management.Automation (in System.Management.Automation.dll)

Dim instance As ICommandRuntime
Dim target As String
Dim returnValue As Boolean

returnValue = instance.ShouldProcess(target)

bool ShouldProcess (
	string target
boolean ShouldProcess (
	String target
function ShouldProcess (
	target : String
) : boolean



The name of the resource to be changed.

Return Value

A 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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


Target Platforms

Windows Developer Preview, Windows Server Developer Preview

Send comments about this topic to Microsoft.
© 2014 Microsoft