News for hackers. Stuff that matters.
Re:Linux and Powershell by sterlind on Tuesday January 19, 2021 @11:25AM (#25835040)
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.

Re:Linux and Powershell by ygra on Tuesday January 19, 2021 @11:30AM (#25835115)
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.
Re:Linux and Powershell by stinos on Tuesday January 19, 2021 @11:30AM (#25835111)
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.

Re:Linux and Powershell by vips7L on Tuesday January 19, 2021 @12:05PM (#25835604)
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.
Re:Linux and Powershell by Tarean on Tuesday January 19, 2021 @11:30AM (#25835107)
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