Skip to content

Get-Command with aliases: .Parameters collection does not include dynamic parameters #18714

@mklement0

Description

@mklement0

Prerequisites

Steps to reproduce

# To avoid an unrelated bug (#18715), make sure that Get-ChildItem was referenced at least once in this session.
$null = Get-ChildItem -? 

# Compare the parameter name reported via Get-ChildItem vs. via alias gci
# Be sure to call this from a *file-system* location.
Compare-Object @((Get-Command Get-ChildItem).Parameters.Keys) @((Get-Command gci).Parameters.Keys)

See also:

Expected behavior

No output (the same set of parameters should be reported by both Get-Command calls).

Actual behavior

InputObject   SideIndicator
-----------   -------------
Attributes    <=
FollowSymlink <=
Directory     <=
File          <=
Hidden        <=
ReadOnly      <=
System        <=

That is, all dynamic parameters are missing from what Get-Command gci).Parameters reported.

Error details

No response

Environment data

PowerShell Core 7.3.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-TriageThe issue is new and needs to be triaged by a work group.Resolution-No ActivityIssue has had no activity for 6 months or more

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions