File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed
reference/docs-conceptual/learn/shell Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change 11---
22description : This article describes how to use aliases in PowerShell.
3- ms.date : 11/21/2025
3+ ms.date : 01/13/2026
44title : Using aliases
55---
66# Using aliases
@@ -113,9 +113,25 @@ For more information, see the [Alias attribute][03] documentation.
113113
114114In addition to parameter aliases, PowerShell lets you specify the parameter name using the fewest
115115characters needed to uniquely identify the parameter. For example, the ` Get-ChildItem ` cmdlet has
116- the ** Recurse** and ** ReadOnly** parameters. To uniquely identify the Recurse parameter, you only
117- need to provide ` -Rec ` . If you combine that with the command alias, ` Get-ChildItem -Recurse ` can be
118- shortened to ` dir -Rec ` .
116+ the ** Filter** and ** Force** parameters. Using ` -F ` is ambiguous because both parameters start with
117+ the letter ` F ` . If you try to use ` -F ` , PowerShell returns an error:
118+
119+ ``` powershell
120+ PS> Get-ChildItem -f
121+ ```
122+
123+ ``` Output
124+ Get-ChildItem : Parameter cannot be processed because the parameter name 'f' is ambiguous. Possible
125+ matches include: -Filter -Force.
126+ ```
127+
128+ To uniquely identify the ** Filter** parameter, you need to use ` -Fi ` .
129+
130+ > [ !NOTE]
131+ > The ` Get-ChildItem ` cmdlet also has a dynamic parameter, ` -File ` . Using ` -f ` , ` -fi ` and ` -fil `
132+ > doesn't create ambiguity with ` -File ` because ` -File ` is a dynamic ` FileSystem ` provider
133+ > parameter. PowerShell binds dynamic parameters after binding static parameters. The only way to
134+ > specify the parameter is to use the full name, ` -File ` .
119135
120136## Don't use aliases in scripts
121137
You can’t perform that action at this time.
0 commit comments