Export (0) Print
Expand All

SwitchParameter Members

Defines a type of parameter that is evaluated based on its presence on the command line. Cmdlets and functions can define switch parameters that are evaluated by the Windows PowerShell runtime when the parameters of the command are bound.

The following tables list the members exposed by the SwitchParameter type.

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

  Name Description
public property IsPresent Gets a value that indicates whether the parameter was specified on the command line.
public property static Present Gets an instance of SwitchParameter object that indicates that the parameter is present.
Top

(see also Protected Methods)
 NameDescription
public methodEqualsOverridden. Compares this SwitchParameter object to another object.
public methodGetHashCodeOverridden. Gets the hash code for the parameter.
public methodGetType  (Inherited from Object)
public methodstaticEqualityOverloaded. Compares two objects and returns true if they resolve to the same value. The variants of this operator can compare a Boolean object to a SwitchParameter object, a SwitchParameter object to a Boolean object, and a SwitchParameter object to another SwitchParameter object.
public methodstaticImplicitOverloaded. Casts a SwitchParameter object to a Boolean object or a Boolean object to a SwitchParameter object.
public methodstaticInequalityOverloaded. Compares two objects and returns true if they resolve to different values. The variants of this operator can compare a Boolean object to a SwitchParameter object, a SwitchParameter object to a Boolean object, and a SwitchParameter object to another SwitchParameter object.
public methodToBoolConverts the current SwitchParameter object to a Boolean object.
public methodToStringOverridden. Generates a string representation of the current SwitchParameter object.
Top

  Name Description
protected method Finalize  (Inherited from Object)
protected method MemberwiseClone  (Inherited from Object)
Top

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