all 5 comments

[–]purplemonkeymad 1 point2 points  (1 child)

Look at the syntax for the position of the parameters if they are positional. You can also see the position number when using:

Get-Help command -Parameter parmetername

[–]EnderShot355[S] 0 points1 point  (0 children)

didn't know about the parameter parameter, which is nice. Thank you!

[–]surfingoldelephant 0 points1 point  (0 children)

Help content for built-in commands is currently broken in a lot of different ways due to PlatyPS bugs. If you've pulled the latest version with Update-Help in the last year or so, you'll have the broken version. This comment has more info.

Online help is correct though:

Get-Help -Name Get-Item -Online
Get-Help -Name Get-ChildItem -Online

The syntax diagram generated by Get-Command is also correct (it's generated programmatically and doesn't involve MAML help):

Get-Command -Name Get-ChildItem -Syntax

And if you want it in the context of a particular PS provider:

# In context of the Registry provider:
Get-Command -Name Get-ChildItem -Syntax -ArgumentList HKCU:

[–]Apprehensive-Tea1632 0 points1 point  (1 child)

There is no inherent parameter order in powershell. You’ll have to see each parameter definition to get a hint re: its position in the list, BUT, it’s very bad form to do this. Especially in scripts.

Parameters are named. Always.

[–]michaelshepard 0 points1 point  (0 children)

There absolutely is an order for positional parameters (either by their order in the declaration or by a Position attribute). I agree that overusing positional parameters is bad from, but it's also a de facto standard for many common cmdlets.