CmdletAttribute.SupportsShouldProcess Property

Gets and sets a Boolean value that indicates whether the cmdlet supports calls to the ShouldProcess method.


Namespace: System.Management.Automation
Assembly: System.Management.Automation (in system.management.automation.dll)

public bool SupportsShouldProcess { get; set; }
/** @property */
public final boolean get_SupportsShouldProcess ()

/** @property */
public final void set_SupportsShouldProcess (boolean value)

public final function get SupportsShouldProcess () : boolean

public final function set SupportsShouldProcess (value : boolean)

Property Value

A Boolean value that indicates true if the cmdlet supports calls to the ShouldProcess method; otherwise, false.

This property is an optional Named parameter of the Cmdlet attribute. For more information about the declaration syntax used to specify the Cmdlet attribute, see CmdletAttribute Declaration.

All cmdlets that change the system should include the SupportsShouldProcess keyword when declaring the Cmdlet attribute, and then call the ShouldProcess method before performing any action that changes the system. If the ShouldProcess call returns false, the action should not be taken.

The Confirm and WhatIf cmdlet parameters are available only for cmdlets that support ShouldProcess calls.


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

Development Platforms

Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP

Target Platforms

Windows Server 2008, Windows Server 2003, Windows Vista, Windows XP
Show: