Questions relating to the PowerShell type [switch].
Example Usage:
function Demo {
[CmdletBinding()]
param (
[switch]$Switch
)
process {
if($Switch.IsPresent) {
"Switch Is Defined"
} else {
"Switch Not Used"
}
}
}
Demo
Demo -Switch
Example Output
Switch Not Used
Switch Is Defined