4 ms·
It may be a 'tired' argument but a valid one. For me I keep using 'dosisms' in powershell. But they do not work because those commands are actually something
by sumtechguy 4y ago
It may be a 'tired' argument but a valid one. For me I keep using 'dosisms' in powershell. But they do not work because those commands are actually something different and you need the params for those items. One that gets me every time is is the 'dir /s' command which does not work in powershell because you should use -recurse which is the command for Get-ChildItem which is what it is really calling.
I think most people have this issue when jumping between shells. Each one is has its own way of working. But adding aliases, I can see why they did it. The problem is it was poorly done up front. Now they are kind of stuck with it and we get to deal with it. Also you may be expecting all of the sorting items out of dir/ls. But you do not get those. You get to pipe it and sort it in a secondary step. Which is fine. But can is a bit of a pain when you are used to something like 'dir /os' vs 'Get-ChildItem . | Sort-Object -Property Length'. It just takes some getting used to. But seems longer and more verbose to get the same effect.
It is nicer though when you want to act on those items though (which is where powershell shines) as everything is in an object and you can slice it down. But using it for 'shell' things like where is a file and what is the biggest in a folder it falls a bit flat and feels like the object model is in the way.
- delta_p_delta_x 4y ago> Get-ChildItem . | Sort-Object -Property Length > where is a file and what is the biggest in a folder You don't need to use the full commands and parameters. The commands have aliases, and parameters can be arbitrarily short (and case-insensitive) as long as they are unambiguous: gci . | sort Length gci . -r -inc <filename> Furthermore, the PowerShell interpreter has an extremely powerful autocomplete, so these should be straightforward to look up.
- sumtechguy 4y agoThank you for the tip.