SwitchParameter Struct
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Type used to define a parameter on a cmdlet script of function that can only be used as a switch.
public value class SwitchParameter
public struct SwitchParameter
[System.Runtime.CompilerServices.IsReadOnly]
public readonly struct SwitchParameter
type SwitchParameter = struct
[<System.Runtime.CompilerServices.IsReadOnly>]
type SwitchParameter = struct
Public Structure SwitchParameter
- Inheritance
-
SwitchParameter
- Attributes
Switch |
Construct a SwitchParameter instance with a particular value. |
Is |
Returns true if the parameter was specified on the command line, false otherwise. |
Present |
Static method that returns a instance of SwitchParameter that indicates that it is present. |
Equals(Object) |
Compare this switch parameter to another object. |
Get |
Returns the hash code for this switch parameter. |
To |
Explicit method to convert a SwitchParameter to a boolean value. |
To |
Returns the string representation for this object. |
Equality(Boolean, Switch |
Implement the == operator for bool and switch parameters. |
Equality(Switch |
Implement the == operator for switch parameters and booleans. |
Equality(Switch |
Implement the == operator for switch parameters objects. |
Implicit(Boolean to Switch |
Implicit cast operator for casting bool to SwitchParameter. |
Implicit(Switch |
Implicit cast operator for casting SwitchParameter to bool. |
Inequality(Boolean, Switch |
Implement the != operator for bool and switch parameters. |
Inequality(Switch |
Implement the != operator for switch parameters and booleans. |
Inequality(Switch |
Implement the != operator for switch parameters. |
Producto | Versiones |
---|---|
PowerShell SDK | 7.2.0, 7.3.0, 7.4.0 |
Windows PowerShell | 5.1.0.0 |