Should we get rid of the list-package command?

Dec 22, 2010 at 12:21 AM

Today, we support both get-package and list-package, and they mean exactly the same thing (list-package is an alias for get-package).  They return either the installed packages, or the feed packages if you specify the -remote flag.

From a pure PowerShell naming point of view, the use of list-package is improper (some arguments here).  So we're considering getting rid of it, and only keeping get-package.

How do people feel about this?  Are you more:

  1. Let's get rid of it, so our PowerShell commands are correctly named
  2. You currently use list-package, but you could equally use get-package, so you don't care either way
  3. get-package sounds really wrong to you compared to list-package, so you;d hate this change

Make yourself heard! :)

Dec 22, 2010 at 12:25 AM
From a die-hard PowerShell'r, option #1 is the only correct option. :-D
Dec 22, 2010 at 12:27 AM

I was afraid of this when we implemented PowerShell support. All the die-hards come out and tell us we have to follow the rules of their playground or it's gonna be fisticuffs. Rules are made to be broken! ;)

Dec 22, 2010 at 12:39 AM

I'm still used to using List-Package as we started with it and it better describes the user action (and, as much as love PowerShell, I think Get-Xxx is silly as a one-size-fits-all convention/rule); but, I think that now is the time to change things. After this, we really do have to worry about breaking folks. Why ship a legacy alias when we don't need legacy baggage?

My vote would be to remove the legacy alias.

Dec 22, 2010 at 12:42 AM

All I have to say is:

"That's Tron. He fights for the Users."

Dec 22, 2010 at 12:47 AM

I'm fine with removing it. I can always redefine it later as my own alias. :)

"Be passionate in all you do"

Dec 22, 2010 at 12:49 AM
The rules are there for a reason. "dir" is an alias for "get-childitem" (which brings up the fact that it should be called "get-package", but whatever... let's at least get close to correct).
Dec 22, 2010 at 12:54 AM

It is Get-Package. And I agree with Rob; if I *really* like List-Package, I can add my own alias.

Dec 22, 2010 at 12:54 AM

Oh, you mean the casing on get-package?

Dec 22, 2010 at 12:55 AM

Well, you probably didn't mean the casing, as it is Get-ChildItem.

Dec 27, 2010 at 7:02 PM

If there's no more objection, I'll go ahead and remove it.

Going once...twice... deal.

Dec 27, 2010 at 11:22 PM


I still object, but it seems I’ve been out-voted. Bye bye list-package. I’ll miss you.

Dec 29, 2010 at 6:22 PM
Edited Dec 29, 2010 at 6:23 PM


One side effect of using the Get verb is that you can omit it altogether. PowerShell's command discovery will prepend "Get-" to a miss and try again. The upshot of this is that "get-package" can be further shortened to "package." Just a general fyi about PS.

You did the right thing. ;-) The way to think about the fixed verb list is that the more you use powershell, the easier it is to figure stuff out. When you sit down to powershell and fire up a new module for the first time, you shouldn't have to guess at how you obtain things. The answer is always Get, and should always be Get. Type "Get-" and hit <tab>. If you use powershell, try to stick to the rules - they benefit everyone even if you don't see it yourself [right now.] If you start making stuff up, you end up with PHP.

Dec 29, 2010 at 8:40 PM

Didn't know that about being able to omit the 'get' verb! On the downside, the fact that it loses intellisense makes it hard to use.

Dec 29, 2010 at 10:25 PM

Not following - what loses intellisense?

Dec 29, 2010 at 10:56 PM

Type 'pack' and press tab, and it doesn't complete it.  Now type 'package -' and press tab, and you don't get switch intellisense.  So in practice, it's not really usable as most users make heavy use of intellisense.  But anyway, using get-package is easy enough, thank to intellisense.

Dec 29, 2010 at 11:04 PM

Ah right - yes, that goes without saying.

Dec 29, 2010 at 11:06 PM

Does it?  I could certainly see it working given the right implementation.  But really, I don't care all that much.  I was just mentioning that the fact that get can be omitted is more of a trivia than a useful thing.

Dec 29, 2010 at 11:23 PM

Yep, effectively it's trivia and tbh, causes more bug reports than smiles from users.