I am trying to build a cool "PowerShell command" (a script containing a global function that I could later use from the shell as a command) and I have a problem.
I am using parameters with param() and there is an option to use a switch parameter (one that does not get subsequent information but just used for an option later on - such as the -l at the Linux command ls).
The thing is that it works fine when the parameter name is a letter, but not with a number. It's strange since numbers could be defined as variables ($4).
What do I need to do?
It suppose to be like ping -6.
Ideas?
Ping {param ([ValidateSet(4,6)][int]$IPVersion) ...}and you still can use this parameter as a boolean later on.