Skip to content

Get-Command -Syntax should work with aliases #5963

Closed

Description

@lzybkr

Steps to reproduce

Get-Command -Syntax del

Expected behavior

del [-Path] <string[]> [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-Recurse] [-Force] [-Crede
ntial <pscredential>] [-WhatIf] [-Confirm] [-UseTransaction] [-Stream <string[]>] [<CommonParameters>]                   
                                                                                                                         
del -LiteralPath <string[]> [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-Recurse] [-Force] [-
Credential <pscredential>] [-WhatIf] [-Confirm] [-UseTransaction] [-Stream <string[]>] [<CommonParameters>]  

Actual behavior

Remove-Item

Activity

  1. added
    Issue-Enhancement
    on Jan 19, 2018
  2. KirkMunro commented on Apr 10, 2019

    @KirkMunro
    Contributor

    I just came here to log this. The existing behavior is most unhelpful.

    One thought I have that differs from the above however is in the case of Get-Command -Syntax $someAliasName, I was thinking I'd prefer it show the actual alias mapping, followed by the syntax for the alias, especially since aliases shouldn't be used in scripts. The thinking behind this is that 100% of the time when I would use gcm del -syntax (or any alias in place of del), I'd be using the alias to save typing, as a shorthand to get the actual syntax for the command that will be invoked, and less as a command I actually want to invoke. So my expected behavior would look more like this:

    del -> Remove-Item
    
    del [-Path] <string[]> [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-Recurse] [-Force] [-Crede
    ntial <pscredential>] [-WhatIf] [-Confirm] [-UseTransaction] [-Stream <string[]>] [<CommonParameters>]                   
                                                                                                                             
    del -LiteralPath <string[]> [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-Recurse] [-Force] [-
    Credential <pscredential>] [-WhatIf] [-Confirm] [-UseTransaction] [-Stream <string[]>] [<CommonParameters>]  
    

    Or maybe the output should actually state "NOTE: del is an alias for the Remove-Item command", at the top or bottom of the output.

  3. TylerLeonhardt commented on Sep 17, 2019

    @TylerLeonhardt
    Member

    Steve Lee (@SteveL-MSFT) potentially a solid hackathon/up-for-grabs issue?

  4. KirkMunro commented on Sep 17, 2019

    @KirkMunro
    Contributor

    TylerLeonhardt A great Hacktoberfest issue.

  5. added
    Hacktoberfest
    Up-for-Grabs
    on Sep 18, 2019
  6. ChrisLGardner commented on Oct 9, 2019

    @ChrisLGardner
    Contributor

    Sounds like an interesting challenge so I'll give it a shot

  7. kvprasoon commented on Oct 28, 2020

    @kvprasoon
    Contributor
  8. added
    Resolution-Fixed
    and removed
    Up-for-Grabs
    on Oct 28, 2020
  9. added
    WG-Cmdlets
    and removed on Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    HacktoberfestIssue-EnhancementResolution-FixedWG-Cmdlets

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions