Required Parameter Name Missing - Works?

I ran the following command and I didn’t expect it to work because -LogName is positional (position 1) and I didn’t specify the parameter name (-LogName). The command did run successfully. (And I wasn’t prompted for LogName.)

Why does the following command run properly?

`Get-EventLog -EntryType "Information" System -Newest 5

Index Time          EntryType   Source                 InstanceID Message
----- ----          ---------   ------                 ---------- -------
3817 Jul 18 10:56  Information Microsoft-Windows...           19 Installation Successful: Wi
3816 Jul 18 10:56  Information Microsoft-Windows...           17 Installation Ready: The fol
3815 Jul 18 10:56  Information Microsoft-Windows...           17 Installation Ready: The fol
3814 Jul 18 10:54  Information WMPNetworkSvc          1074607998 The description for Event I
3813 Jul 18 10:54  Information WMPNetworkSvc          1074607998 The description for Event I`

As far as I know the first parameter you do not specify the parameter name for, will be considered the first positional parameter. The same can be observed in examples like:

Get-ChildItem -Recurse "C:\Windows"

Whenever I run into one of these “WTF?!?” moments, I haul out Trace-Command. It can show me what’s being bound where, and how. Would a tutorial be helpful? If so, I’ll write one up for an upcoming TechLetter.

I’d like to see an article on that.