Comment by WorldMaker
Comment by WorldMaker 2 days ago
There are ton of aliases. It's "impolite" [0] to use aliases in scripts and documentation so looking at PowerShell examples is way more verbose than actually using it day to day in a REPL. Sure I could write `Set-Location` a million times a day, but I just use `cd` in the old ways. Same with `Get-ChildItem`, I tend to just use `ls` myself because of ancient habits. (I find it interesting how many have been moving to `gci` instead as the more PowerShell-native `ls` alias. I've not been convinced to do that myself, but I think it has to do with `gci` is way more powerful than most shells' `ls` and is used to navigate everything from folder structures to object structures including that its not a bad `jq` if you convert JSON files to PowerShell objects.)
[0] It's from a version of the Python ethos that code is read way more often than it is written, so when you are polishing PowerShell code to share with others you expand all the aliases so that it is easier to read.
Using a different set of commands in the terminal versus scripts and documentation makes no sense to me, why would I want to learn two different ways do the same thing? Python does not expect me to use `open` in the REPL but prefer `get_file_handle` in published scripts, their ethos works because the entire language has an emphasis on relatively concise readability.
Every single command starting with `Get-` or `Set-` adds so much noise and makes things really hard to visually distinguish too. I don't want overly verbose commands in scripts for the same reason I don't want them in the terminal, it's still a pain to write and even if you have some autocomplete it makes editing harder. I don't think `ls` is any less clear or harder to learn than `Get-ChildItem` really, that name doesn't even actually give me any clue what the command does.