Windows Vista Forums

Alias name in parameter prompt instead of cmdlet name
  1. #1


    Jouko Kynsijärvi Guest

    Alias name in parameter prompt instead of cmdlet name

    If i type an alias but omit required parameters, PS prompts for them:

    [PS] ni
    cmdlet ni at command pipeline position 1
    Supply values for the following parameters
    Path[0]:

    I would have expected that PS would have shown the real cmdlet name in the
    prompt (instead of alias) as below:

    cmdlet New-Item at command pipeline position 1

    Is this a feature or a bug?



    Showing the cmdlet name would have the benefit of making it more clear what
    cmdlet is actually going to run - if i didn't remember the parameters, there
    is a good possibility i also typed in the wrong alias...



      My System SpecsSystem Spec

  2. #2


    Alex K. Angelopoulos [MVP] Guest

    Re: Alias name in parameter prompt instead of cmdlet name

    This sounds like it would also provide a handy fringe benefit for
    security/reliability. Instead of just replacing the alias information, it
    may be best to provide an alternative display that includes the invocation
    name. Maybe something like this, used only when the name required alias
    resolution?

    cmdlet New-Item (invoked as alias:\ni) at command pipeline position 1...



    "Jouko Kynsijärvi" <jouko.kynsijarvi@nospam.nospam> wrote in message
    news:OxlTddNfGHA.3572@TK2MSFTNGP04.phx.gbl...
    > If i type an alias but omit required parameters, PS prompts for them:
    >
    > [PS] ni
    > cmdlet ni at command pipeline position 1
    > Supply values for the following parameters
    > Path[0]:
    >
    > I would have expected that PS would have shown the real cmdlet name in the
    > prompt (instead of alias) as below:
    >
    > cmdlet New-Item at command pipeline position 1
    >
    > Is this a feature or a bug?
    >
    > Showing the cmdlet name would have the benefit of making it more clear
    > what cmdlet is actually going to run - if i didn't remember the
    > parameters, there is a good possibility i also typed in the wrong alias...
    >
    >




      My System SpecsSystem Spec

  3. #3


    Kevin Loo [MSFT] Guest

    Re: Alias name in parameter prompt instead of cmdlet name

    Alex,
    This is an interesting suggestion. Could you bug this feature request?
    Thanks.
    --
    Kevin Loo [MSFT]
    Windows PowerShell Development
    Microsoft Corporation
    This posting is provided "AS IS" with no warranties, and confers no rights.

    "Alex K. Angelopoulos [MVP]" <a k a @ m v p s . o r g> ¼¶¼g©ó¶l¥ó·s»D:O4N2IYPfGHA.3572@TK2MSFTNGP04.phx.gbl...
    > This sounds like it would also provide a handy fringe benefit for
    > security/reliability. Instead of just replacing the alias information, it
    > may be best to provide an alternative display that includes the invocation
    > name. Maybe something like this, used only when the name required alias
    > resolution?
    >
    > cmdlet New-Item (invoked as alias:\ni) at command pipeline position 1...
    >
    >
    >
    > "Jouko Kynsijärvi" <jouko.kynsijarvi@nospam.nospam> wrote in message
    > news:OxlTddNfGHA.3572@TK2MSFTNGP04.phx.gbl...
    >> If i type an alias but omit required parameters, PS prompts for them:
    >>
    >> [PS] ni
    >> cmdlet ni at command pipeline position 1
    >> Supply values for the following parameters
    >> Path[0]:
    >>
    >> I would have expected that PS would have shown the real cmdlet name in
    >> the prompt (instead of alias) as below:
    >>
    >> cmdlet New-Item at command pipeline position 1
    >>
    >> Is this a feature or a bug?
    >>
    >> Showing the cmdlet name would have the benefit of making it more clear
    >> what cmdlet is actually going to run - if i didn't remember the
    >> parameters, there is a good possibility i also typed in the wrong
    >> alias...
    >>
    >>

    >
    >




      My System SpecsSystem Spec

  4. #4


    Alex K. Angelopoulos [MVP] Guest

    Re: Alias name in parameter prompt instead of cmdlet name

    https://connect.microsoft.com/feedba...edbackID=78916

    "Kevin Loo [MSFT]" <kevinloo@online.microsoft.com> wrote in message
    news:ercYSRdfGHA.764@TK2MSFTNGP03.phx.gbl...
    > Alex,
    > This is an interesting suggestion. Could you bug this feature request?
    > Thanks.
    > --
    > Kevin Loo [MSFT]
    > Windows PowerShell Development
    > Microsoft Corporation
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >
    > "Alex K. Angelopoulos [MVP]" <a k a @ m v p s . o r g>
    > ¼¶¼g©ó¶l¥ó·s»D:O4N2IYPfGHA.3572@TK2MSFTNGP04.phx.gbl...
    >> This sounds like it would also provide a handy fringe benefit for
    >> security/reliability. Instead of just replacing the alias information, it
    >> may be best to provide an alternative display that includes the
    >> invocation name. Maybe something like this, used only when the name
    >> required alias resolution?
    >>
    >> cmdlet New-Item (invoked as alias:\ni) at command pipeline position 1...
    >>
    >>
    >>
    >> "Jouko Kynsijärvi" <jouko.kynsijarvi@nospam.nospam> wrote in message
    >> news:OxlTddNfGHA.3572@TK2MSFTNGP04.phx.gbl...
    >>> If i type an alias but omit required parameters, PS prompts for them:
    >>>
    >>> [PS] ni
    >>> cmdlet ni at command pipeline position 1
    >>> Supply values for the following parameters
    >>> Path[0]:
    >>>
    >>> I would have expected that PS would have shown the real cmdlet name in
    >>> the prompt (instead of alias) as below:
    >>>
    >>> cmdlet New-Item at command pipeline position 1
    >>>
    >>> Is this a feature or a bug?
    >>>
    >>> Showing the cmdlet name would have the benefit of making it more clear
    >>> what cmdlet is actually going to run - if i didn't remember the
    >>> parameters, there is a good possibility i also typed in the wrong
    >>> alias...
    >>>
    >>>

    >>
    >>

    >
    >




      My System SpecsSystem Spec

Alias name in parameter prompt instead of cmdlet name problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cmdlet and parameter sets Patrick Dreyer PowerShell 2 14 Nov 2008
cmdlet parameter sets Darren Mar-Elia PowerShell 13 08 Nov 2007
How to set alias for my cmdlet when my snapin is registered Rostislav.Pridatko@quest.com PowerShell 1 16 Mar 2007
Set alias with parameter Jeffery Hicks PowerShell 4 23 Jan 2007
Cmdlet Parameter Positon Keith Hill [MVP] PowerShell 2 23 Nov 2006