Closed jhoek closed 6 years ago
To make the necessary distinction between undefined and explicitly false, use MyInvocation.BoundParameters (from PSCmdlet).
Not bound => value = null bound => value = switch value
Switch value is true by default (if present), but can set to explicitly false using this: -MySwitch:$false
Search for public bool? and public Nullable<bool> in code!
public bool?
public Nullable<bool>
To make the necessary distinction between undefined and explicitly false, use MyInvocation.BoundParameters (from PSCmdlet).
Not bound => value = null bound => value = switch value
Switch value is true by default (if present), but can set to explicitly false using this: -MySwitch:$false
Search for
public bool?
andpublic Nullable<bool>
in code!