4 ms·
> The powershell command names though Just wondering if you're talking about command name length or something else? Asking because it comes up a lot and almos
by doorhammer 3y ago
> The powershell command names though
Just wondering if you're talking about command name length or something else?
Asking because it comes up a lot and almost all the common commands have idiomatic short/terse versions (gci for Get-ChildItem, etc).
No shade, though. No reason you'd know if you don't have a reason to know it.
Would love to hear if I'm making the wrong assumption and it's something else you're talking about. I personally really love powershell, but also get why people love bash. I'm still pretty comfortable with bash because I work in *nix systems mostly, so it makes sense for me to know it, whereas the reverse (with ps) isn't really true for most devs
- justeleblanc 3y agoIt's just a knee-jerk reaction people have in any thread where powershell is mentioned. "Hur hur long command names." Doesn't bring anything to the discussion.
- doorhammer 3y agoYeah, it can definitely be kind of a meme, but also I've never had a bad time bringing it up in good faith. A lot of people don't even realize it's a knee-jerk meme response to them. OP also doesn't seem to just be MS bashing, and I think there's a reality that the typical linux/macos dev just doesn't have a compelling reason to sink time into vetting PS, whereas I had a reason to learn it and ended up really digging it. But I do get what you're saying and think it's a common meme that's often unhelpful
- lucb1e 3y agoI can see where you're coming from, but to me it's not some meme or joke. I find it similarly annoying in Java, for example, and it makes me want to use that language less. Obviously it's only a small part of the whole consideration.
- kaba0 3y agoWhat’s long in Java? It sure longer than the absolutely insane C convention of snrcph whatever, but these AbstractFactoryFactory things are just memes - the Java convention is to prefer full words, but that’s the same in I believe the majority of languages - JS, Rust, Python all use basically identical names, at most casing differs.
- justeleblanc 3y agoEvery common command has a short alias, or often multiple short alias. Get-ChildItem => "ls", "gci". Get-Content => "gc", "cat". These aliases are standardized, you can look them up with Get-Alias (or "gal" ;) ). It means that working in the terminal, you can use short commands, and when you write a long-term script, you use the long names so that the script is more readable. What I find great is that flags also have aliases that are standardized across commands. This is why I'm annoyed at this meme. It just stems from ignorance.
- lenkite 3y agoI assume you similarly also find Apple's swift/objc API's annoying. (If not, might want to objectively evaluate bias)
- SturgeonsLaw 3y agoIt has its benefits, other people's scripts are very readable, and often you can just guess the correct command without having to look anything up.
- tomjen3 3y agoIt doesn't bring anything new to the discussion, but if it is the reason people don't use it, then it is relevant. I don't use it, because I was Mac/Linux at home and Linux at work for so long - only now do I have a reason to.
- doorhammer 3y agoI think that's important, tbh I love powerful. I've used it for a long and even though I primarily work on macos/linux now, I install powershell core on everything. That said, I _started_ using it because I was working on a windows box doing C# and managing windows servers. There's just not a compelling reason for a dev to learn it outside of personal interest, and I think that's a completely legit mindset, since we all have limited time. I'm even fine with misconceptions--we all have them about something--as long as the person is being a decent human about it (which is why I've enjoyed this thread/comments)
- lucb1e 3y agoYeah that's basically it, so thanks for mentioning abbreviations! I knew they had some aliases (e.g. ls, curl) but not that it was commonplace because any powershell tutorial uses the long form and capitalizes everything (indeed I don't interact with PS a lot). It all feels very design-by-committee. Not sure whether it's a good thing that guides never use the short form: long more readable, but the specific choices of words give me weird vibes and run off blog-width line lengths. OP shows that nicely with the bash version fitting on ~60% of the line (on my screen) but the PS version running out of the line. A lot has been written about naming things and brevity versus clarity, and while I sit very firmly on the programmer's side as opposed to the math people side (single letter variable names, in weird fonts or languages if they (surprise!) run out of available letters), I think I am more of a bash person than a java person in terms of naming things. Word-ish commands like pushd, kill, read, etc. (taking some bash built-ins here as examples, rather than external programs which may be named arbitrarily) seem a lot nicer to me than either very long commands or acronyms where you basically still have to know the long form to remember it. I'd never have guessed that spps stands for stop-process yet that's the portable powershell form of 'kill' (just looked that one up).
- shortrounddev 3y agoI think the long form is because people usually tab to complete the names. Personally once you learn them they dont get that hard to type
- doorhammer 3y ago100% and I never thought of that before but I can see how you'd get that impression from tutorials. The VSCode powershell extensions will also give you suggestion squigglies under all of your aliases in a saved script if they're not long-form, but I usually mix and match based on pragmatism. My use of alias vs long-form usually comes down to two sort of situations: * Ad-hoc at the shell: all aliases all the time (and make my own if I need to. welcome to my godless wasteland, population: me) * Shared scripts: Just like any code, do what's idiomatic for the team. Usually it's largely aliases with some long-form In practice I'd say the formatting consistency situation on teams isn't nearly as bad as SQL but obviously not as good as Go. For reference, I'm also a huge APL fan, so hit me with arcane symbols in my free-time all day long, but definitely pragmatic balance at work. I also don't even think of them as acronyms personally. The acronym just sort of means the semantic action in my brain at this point, but I think that's mostly a fluency thing, and can't really speak to it being hurtful/helpful since I'm so removed from when I first started learning it
- zamadatix 3y agoEven with the default short aliases like gci there are only ~100 unique commands/commandlets aliased and 600 commandlets in a default install. Not to mention what happens when you start loading other commandlets. Trying to predicate your usage of PS on just using short commands is also going to fall short in documentation and searches. I recommend just getting used to the fact command names are long. <tab> is a good friend too.
- kaba0 3y agoOften mentioned failing of powershell commands is that they went with Verb-Noun, when the reverse would have been much more discoverable. You want to specify what you want to operate on first, Get-<Tab> will be much less useful then Process-<Tab>. Otherwise, despite their length I do like these long names, you can have aliases for ‘ls’ and alia, and flags fuzzy match.
- lenkite 3y agoIs there a Powershell script to disable adware on a windows 11 box ?
- doorhammer 3y agolol, you know what's funny is that I actually used to have a script like that for windows 10. I volunteered to help a local nonprofit image a bunch of laptops and they'd bought win 10 home licenses for something like 30 laptops. The whole thing was kind of a nightmare but got most of the adware stripped out, I think, but not all of it. been awhile, so hard to remember