Using System.Management.Automation you can create custom PSCmdlets in C#. Now if you create boolean parameter like this:
[Parameter()]
public bool ShowDefinition { get; set; }
You have to invoke cmdlet like this:
PS> Get-CustomValues -ShowDefinition 1
But I would like to invoke it without passing value to -ShowDefinition. The same way as -Debug works. Like this:
PS> Get-CustomValues -ShowDefinition
How can I do this?
OK, I found the answer.
You have to use SwitchParameter.