Analyze Parameter Binding

by Nov 12, 2009

You probably know that PowerShell is pretty flexible when it comes to parameters you want to submit to cmdlets and functions. You can name them (putting the parameter name in front of your arguments), you can abbreviate the name (as long as the parameter name is not ambiguous), and you can even use some positional parameters (no parameter name needed if you specify the arguments in the right order). You can examine it to find out how PowerShell actually performs this amazing parameter binding:

trace-command -name parameterbinding {dir c:\ *.* -recurse} -pshost

This command analyzes the code in brackets.

Twitter This Tip! ReTweet this Tip!