Objective: Increase the frequency of alias use,Reduce learning costs
Type tabs to display aliases
PS >get-process <tab>
gps -> Get-Process
PS >Get-It <tab>
gi -> Get-Item gp -> Get-ItemProperty gpv -> Get-ItemPropertyValue
PS >Get-It <tab>
Get-Item Get-ItemProperty Get-ItemPropertyValue
I am not convinced about the need for this.
In general, best practice suggests NOT using aliases in production code. Encouraging more use seems to be anti-best practice. For that reason alone, I am not keen on this idea.
BUT: this might be useful in an interactive session where terseness can be a virtue. However,
I teach students to do this:
gal -def get-alias
I also train them on when and when not to use aliases.
Even if we wanted this feature, using Tab today does do _something useful, If you type a tab after a cmdlet name, PowerShell iterates through items based on the cmdlet (eg with Get-Alias
TL;DR - I am not convinced we need such a device and in any case, it changes existing behaviour in a way less helpful.
In general, best practice suggests NOT using aliases in production code. Encouraging more use seems to be anti-best practice. For that reason alone, I am not keen on this idea.
Agree
A better solution would be to have a PS Readline keybinding which shows get-alias -definition [current token]
but not bind it to tab.
This issue has been marked as answered and has not had any activity for 1 day. It has been closed for housekeeping purposes.
Most helpful comment
I am not convinced about the need for this.
In general, best practice suggests NOT using aliases in production code. Encouraging more use seems to be anti-best practice. For that reason alone, I am not keen on this idea.
BUT: this might be useful in an interactive session where terseness can be a virtue. However,
I teach students to do this:
I also train them on when and when not to use aliases.
Even if we wanted this feature, using Tab today does do _something useful, If you type a tab after a cmdlet name, PowerShell iterates through items based on the cmdlet (eg with Get-Alias it runs through the aliases, Get-ChildItem runs through files. Changing this behaviour to show aliases is not helpful. Tabl Completion is about _completing_ a command line, not in showing alternatives (eg aliases).
TL;DR - I am not convinced we need such a device and in any case, it changes existing behaviour in a way less helpful.