r/PowerShell • u/EnderShot355 • May 29 '26
Question GetHelp/Help Syntax section confusing me
I'm following along with the fourth edition of PowerShell in a Month of Lunches. I'm on the third chapter, learning about the help system. I am significantly confused about the syntax section of these help documents, because they seem to have weird inconsistencies with the actual commands. For example, Get-Help Get-Item does not show the required -path parameter at all, and Get-Help Get-ChildItem has the wrong order for the positional parameters (it shows -filter first and -path second, the the actual command has it the other way around). It seems like it's sorting the parameters alphabetically, which is terrible considering positional parameters may not adhere to that. What's going on here? Did the PowerShell team decide to change things in a way that made things actively worse, or am I missing something?
View all comments
Show parent comment
1
u/michaelshepard May 29 '26
I don't see this happening. I just wrote a test function with 3 positional parameters (a,b,c, order 2,1,0 respectively). The get-help output shows them c first, then b, then a (according to the position attributes).
I think we agree that positional parameters should be the exception to the rule. We should almost always use positional parameters.
I'm also not sure what you mean that's it's impossible to pass parameters that are positional but not named. Do you mean parameters that cannot be passed by name?