Export (0) Print
Expand All

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

Windows Developer Preview, Windows Server Developer Preview

Send comments about this topic to Microsoft.
Show:
© 2014 Microsoft