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)

Dim isPresent As Boolean

Dim instance As New SwitchParameter(isPresent)

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



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

© 2015 Microsoft