Deciphering PowerShell Syntax Help Expressions

In my last post I showed several instances of the syntax help that you get when you use get-help or -? with a cmdlet. For instance: This help is showing how the different parameters can be used when calling the cmdlet. If you’ve never paid any attention to these, the notation can be difficult to work …

Continue reading ‘Deciphering PowerShell Syntax Help Expressions’ »

Specifying PowerShell Parameter Position

Positional Parameters Whether you know it or not, if you’ve used PowerShell, you’ve used positional parameters. In the following command the argument (c:\temp) is passed to the -Path parameter by position. The other option for passing a parameter would be to pass it by name like this: It makes sense for some commands to allow …

Continue reading ‘Specifying PowerShell Parameter Position’ »

PowerShell Parameter Disambiguation and a Surprise

When you’re learning PowerShell one of the first things you will notice is that you don’t have to use the full parameter name.  This is because of something called parameter disambiguation. When it works For instance, instead of saying Get-ChildItem -Recurse, you can say Get-ChildItem -R.  Get-ChildItem only has one (non-dynamic) parameter that started with the …

Continue reading ‘PowerShell Parameter Disambiguation and a Surprise’ »