Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.


Go Back   Vista Forums > Misc Newsgroups > PowerShell

RB

Vista - Alias name in parameter prompt instead of cmdlet name

Reply
 
05-21-2006   #1
Jouko Kynsijärvi


 
 

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
05-21-2006   #2
Alex K. Angelopoulos [MVP]


 
 

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
05-22-2006   #3
Kevin Loo [MSFT]


 
 

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
05-23-2006   #4
Alex K. Angelopoulos [MVP]


 
 

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
Reply

RB


Thread Tools


Similar Threads for: Alias name in parameter prompt instead of cmdlet name
Thread Forum
Cmdlet and parameter sets PowerShell
cmdlet parameter sets PowerShell
How to set alias for my cmdlet when my snapin is registered PowerShell
Set alias with parameter PowerShell
Cmdlet Parameter Positon PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd