Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SwitchParameter Constructor

SwitchParameter Constructor

Initializes a new instance of the SwitchParameter class that identifies whether the switch is present.


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

'Usage
Dim isPresent As Boolean

Dim instance As New SwitchParameter(isPresent)

public:
SwitchParameter (
	bool isPresent
)
public SwitchParameter (
	boolean isPresent
)
public function SwitchParameter (
	isPresent : boolean
)

Parameters

isPresent

true to specify that the parameter is present; otherwise, false.

The following example shows how to declare a parameter of type SwitchParameter.

[Parameter(Position = 1)]
public SwitchParameter GoodBye
{
  get { return goodbye; }
  set { goodbye = value; }
}
private bool goodbye;

 

Target Platforms


Show:
© 2015 Microsoft