Skip to content

Get-CommandSyntax

SYNOPSIS

Get provider-specific command syntax.

SYNTAX

Get-CommandSyntax [-Name] <String> [<CommonParameters>]

DESCRIPTION

Some PowerShell commands are provider aware and may have special syntax or parameters depending on what PSDrive you are using when you run the command. In Windows PowerShell, the help system could show you syntax based on a given path. However, this no longer appears to work. This command is intended as an alternative. Specify a cmdlet or function name, and the output will display the syntax detected when using different providers. Dynamic parameters will be highlighted with an ANSI-escape sequence.

EXAMPLES

Example 1

PS C:\> Get-CommandSyntax -Name Get-Item

Registry

Get-Item [-Path] <string[]> [-Filter <string>] [-Include <string[]>]
[-Exclude <string[]>] [-Force] [-Credential <pscredential>]
[<CommonParameters>]

Get-Item -LiteralPath <string[]> [-Filter <string>] [-Include <string[]>]
[-Exclude <string[]>] [-Force] [-Credential <pscredential>]
[<CommonParameters>]


Alias

Get-Item [-Path] <string[]> [-Filter <string>] [-Include <string[]>]
[-Exclude <string[]>] [-Force] [-Credential <pscredential>]
[<CommonParameters>]

Get-Item -LiteralPath <string[]> [-Filter <string>] [-Include <string[]>]
[-Exclude <string[]>] [-Force] [-Credential <pscredential>]
[<CommonParameters>]

...

The output will show each PowerShell Provider and the corresponding command syntax. Dynamic parameters will be highlighted by color.

PARAMETERS

-Name

Enter the name of a PowerShell cmdlet or function. Ideally, it has been loaded into the current PowerShell session.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

System.String

NOTES

Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/

Get-Help

Get-Command

Back to top