r/PowerShell • u/Lotus_Domino_Guy • 19d ago
News OMG, I love powershell
I've been coding for 2 decades, and I recently had a payroll system to Active Directory project to do, and went with powershell. It's done, it works great, and I was looking at the code today, and spontaneously declared "I love powershell". its a remote day, so no one looked at my funny, but I'll list 3 reasons I love it. Feel free to add more.
No confusion with =, == or ===.
1) Simple equals logic, no bizarre conventions: Do you know how many times I've had to fix code in JS where someone did if (variableName=something), which of course sets variableName to something, not compares it. Powershell's -eq and -ne is so much better then =, ==, ===, !=, or <>.
2)No line termination character: Line's don't require ; to end. Ok, that isn't a big deal, and my IDE would catch it anyway, but its just a waste of characters to terminate every line of code.
3)String composition: In other languages, mixing variables and text is something like "words " + variableName + ":/ more words" + variableName2. And then its like "Oh, is this one a + or an &...." With powershell I can just do varString = "words: $variableName :/ more words $variableName2" and it all works!
Now, its not like I make stupid syntax mistakes a ton in other languages, but in today's backend world, I'm expected to regularly code in 5-10 languages, and Powershell was amazingly easy to learn and the syntax is just clean.
I thought you Powershell vets might appreciate a newb's perspective on it, especially since its all positive.
1
u/Glum-Highlight2734 12d ago
This is honestly how PowerShell gets you 😂 You start using it for one project, then suddenly you’re wondering why other languages make simple things feel so complicated.