Hi Folks. First I would like to thank you all for the community. I’m from Brazil and become a really PowerShell fan. I found a issue on Version 5.0 when look to Parameter Position Attribute. When I look for help using get-help about_parameters I receive the sample below:
Parameter Position?
This setting indicates whether you can supply a parameter’s value
without preceding it with the parameter name. If set to “0” or “named,”
a parameter name is required. This type of parameter is referred to as
a named parameter. A named parameter can be listed in any position
after the cmdlet name.
If the “Parameter position?” setting is set to an integer other than 0,
the parameter name is not required. This type of parameter is referred
to as a positional parameter, and the number indicates the position
in which the parameter must appear in relation to other positional
parameters. If you include the parameter name for a positional
parameter, the parameter can be listed in any position after the
cmdlet name.
For example, the Get-ChildItem cmdlet has Path and Exclude parameters.
The “Parameter position?” setting for Path is 1, which means that it
is a positional parameter. The “Parameter position?” setting for Exclud
is 0, which means that it is a named parameter.
This means that Path does not require the parameter name, but its
parameter value must be the first or only unnamed parameter value
in the command. However, because the Exclude parameter is a named
parameter, you can place it in any position in the command.
As a result of the “Parameter position?” settings for these two
parameters, you can use any of the following commands:
Get-ChildItem -path c:\techdocs -exclude *.ppt
Get-ChildItem c:\techdocs -exclude *.ppt
Get-ChildItem -exclude *.ppt -path c:\techdocs
Get-ChildItem -exclude *.ppt c:\techdocs
If you were to include another positional parameter without including
the parameter name, that parameter would have to be placed in the order
specified by the “Parameter position?” setting.
When I look for help of Get-ChildItem -Full the parameter -Path had the value of 0 instead of 1. I found the same issue in all others cmdlets help files, like get-acl, get-content and others. As the output said before, when you have a 0 value, that means you gonna have to use the parameter name. Does anyone know Why this? Should we contact Microsoft to Update the Help or change the PowerShell dll?
Sorry if my text could be a little confuse. Every body feel free to correct me and help me out improve my English.
Thx.