PowerShell Alias – Documentation for Alias Definitions for PowerShell Arguments with Get-ChildItem

aliaspowershell

In an answer here on superuser.com, it is pointed out that gci -af is an alias for gci -File. That information is correct, and both command lines produce the same result of file listings.

However, I have not been able to find out a source of documentation where the -af alias is defined. For example, it is not defined in the primary documentation page for Get-ChildItem.

Is there another set of aliases for command line arguments when the command name itself is abbreviated, as in using gci for Get-ChildItem?

Best Answer

Down on the parameter lists of the documentation, you can find that -af is inded documented as an alias of -File.

-File

To get a list of files, use the File parameter. You can use the Recurse parameter with File.

Type:                                              SwitchParameter

Aliases:                                           af

Position:                                          Named

Default value:                                  None

Accept pipeline input:                      False

Accept wildcard characters:            False

Related Question