This topic has not yet been rated - Rate this topic

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.
Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.