How to disable positional parameter binding in PowerShell vNext

Monday, September 19, 2011

var addthis_config = {"data_track_clickback":true}; Windows PowerShell supports two kind of parameters: Named and Positional. In a nutshell, Named parameters must be specified on the command line while Positional parameters are inferred by the argument’s position on the command line. The type of the parameter is controlled by the attribute (see about_Parameters). What if we wanted to disable positional parameters and force users to write the parameter name and its value? Consider the following example, all parameters values are positional. Can you guess the parameter names? PS> Register-ObjectEvent $timer Elapsed Timer.Random...