Hacker News new | past | comments | ask | show | jobs | submit login

Fwiw, those aliases you mention all exist. I always do "ls" and "cd" for example. But what really annoys me is that there's no aliases for arguments. So "find . -name foo" becomes "ls -Recurse -Include foo" which makes my carpal tunnel just a little worse.

It's a shame because the rest of Powershell is so good.




There are aliases for parameters, `-ea` for `-ErrorAction` comes to mind. But those are defined by cmdlets, not the user.

However, you can always shorten parameter names as long as they remain unambiguous with other parameters, so

    Get-ChildItem -Recurse -Include foo
would become

    ls -r -i foo
which just happens to be shorter than your 'find' example.


there's no aliases for arguments

There are (if implemented by the function), and moreover you can use just shrink the name to the point it becomes ambiguous. Your example is the same a "ls -r -i foo".

Also tab completion. You never type those out in full, no carpal tunnel, it's just "l -r" the TAB and select what you want. Discoverability is everything in PS.


Powershell is smart enough to find the argument as long as it's not ambiguous. For instance:

    Remove-Item -r -fo ./path/to/some/directory
Powershell is smart enough to know that -r means -Recurse and -fo means -Force because the Remove-Item cmdlet has no other parameter that starts with -r. For -f there are two possible arguments: -Filter and -Force which is why you need to be more specific with -fo.


For commands you use frequently you can still use shortforms, positional arguments, and tab completion, though.

For instance in powershell you can also do:

    ls -r foo




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: