Skip to content

Suggestion: make it easier to discover which cmdlet parameters accept wildcard patterns, via the syntax diagram #4715

@mklement0

Description

@mklement0

Related: #4135 and #4626.

Currently, it is not easy to discover which of a given cmdlet's / advanced function's parameters accept wildcard patterns as arguments

Using the example of Get-Item:

  • You can use Get-Help Get-Item -Full and then browse the entire topic for Accept wildcard characters? lines.

  • To query wildcard support for a given parameter, you can use:
    Get-Help Get-Item -Parameter Path and read the description - however, due to a separate issue, most cmdlets do not allow programmatic discovery of wildcard-supporting parameters.

Neither option is convenient.

Perhaps the syntax diagrams could be enhanced with symbols that reflect support for wildcard patterns?

Something along the lines of (these are mere examples; the idea is to be concise):

-Param* <type>

Applied to the Get-Item example:

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

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

Note: While the -Filter parameter supports wildcards for the FileSystem provider, this may not be true for all providers - what the -Filter parameter accepts is entirely provider-dependent; case in point: the wildcard-pattern language supported by the FileSystem provider differs (is less powerful than) PowerShell's wildcard-pattern language.

Written as of PowerShell Core v6.0.0-beta.6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreWG-Interactive-HelpSystemhelp infrastructure and formatting of help

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions