Windows Dev Center

Expand Minimize

ShouldProcessReason Enumeration

Defines any special circumstances surrounding the call to the Cmdlet.ShouldProcess, ICommandRuntime.ShouldProcess, or CmdletProvider.ShouldProcess method. For example, one circumstance may be because the WhatIf parameter was specified at the command line.

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

Dim instance As ShouldProcessReason

<FlagsAttribute> _
Public Enumeration ShouldProcessReason
/** @attribute FlagsAttribute() */ 
public enum ShouldProcessReason
public enum ShouldProcessReason

Member nameDescription
NoneNo special circumstances existed.
WhatIfThe WhatIf parameter was specified at the command line, or the $WhatIfPreference variable is set.

WhatIf behavior can be requested explicitly using the WhatIf parameter of the cmdlet, or implicitly for all cmdlets that support ShouldProcess by setting the $WhatIfPreference variable. Other hosts may have other ways to request WhatIf behavior.


Target Platforms

© 2015 Microsoft