0

I'm a verbose person so I usually create a new directory without using aliases like this.

New-Item Donkey -ItemType d

A less verbose colleague nagged about it and, since I'm such a pleasure and joy to work with, I thought I'll short it down, because I want the unverbose people to be content too. So I went like this.

ni Donkey -ItemType d

Then, something hit me and I tried the following, just for the fun of it, fully expecting to get the slap telling me to go and do stuff to myself.

ni Donkey -it d

Wouldn't you know? It actually worked! So, happy about making everything totally cryptic for my verbality aversed friend, I started to investigate what else I could abbreviate. I went like this.

Get-Help ni
Get-Help it

Whereas the first one gave me the command including it's alias, just as expected, the second one barked at me telling me there's no such thing. Well, I beg its pardon but I just executed the command so I know there is.

After a few "There's too! There's not. There's too! There's not." I realized that I'm not going to win against the stubborn, red message of PowerShell. So, here's my questions.

  1. Is it an alias to begin with?
  2. How can I get help on it (be that alias or something else)?
  • 1
  • "it" is the first 2 letters of -ItemType parameter name. Thus if there is only one parameter that starts with such symbols you may not type the whole name.
  • Get-Help New-Item -Full
  • – t1meless Oct 22 '16 at 13:06
  • @t1meless is correct (and should post this as an answer). "it" is not an alias, it is a short way to write the parameter and only works because no other parameter for this cmdlet shares the same prefix. You can shorten this parameter to "i", since it is the only parameter for the cmdlet to start with this letter. Get-Help it does not yield a result because Get-Help returns information for cmdlets, not parameters. More here, http://stackoverflow.com/questions/7262802/shorter-versions-of-powershell-cmdlet-parameters – root Oct 22 '16 at 14:40
  • @t1meless Hehe, I see it now. I got fooled by the capitalization of ItemType and missed that it is both that and the prefix. Great info. Also, the flag -full will be useful. You should definitely post it as an answer. – Konrad Viltersten Oct 22 '16 at 16:44