Positional Parameter
noun
say it: “puh-ZISH-uh-nul puh-RAM-ih-ter” /pəˈzɪʃənəl pəˈræmɪtər/
A PowerShell parameter whose value can be given without typing its name, because PowerShell knows it from where the value sits on the line.
What is a positional parameter in PowerShell?
A positional parameter is one whose value you can type without its name: PowerShell knows which parameter it is from where it sits. -Name is the first position of Get-Service, so these two lines do the same. In scripts, write the name: it says what the value is.
Get-Service -Name Audiosrv
Get-Service Audiosrv
In a sentence
- “-Name is a positional parameter of Get-Service, so Get-Service Audiosrv works.”
- “In his script, Ravi wrote the positional parameter out by name, so others could read it.”
Level: Apprentice · More PowerShell terms at this level
Updated