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)

Usage

Syntax

'Declaration
Public Property SupportsShouldProcess As Boolean
public bool SupportsShouldProcess { get; set; }
public:
virtual property bool SupportsShouldProcess {
    bool get () sealed;
    void set (bool value) sealed;
}
/** @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.

Remarks

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.

Thread Safety

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

Platforms

Development Platforms

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

Target Platforms

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

See Also

Reference

CmdletAttribute Class
CmdletAttribute Members
System.Management.Automation Namespace

Other Resources

CmdletAttribute Declaration
Cmdlets
Windows PowerShell SDK