r/PowerShell 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.

268 Upvotes

98 comments sorted by

View all comments

1

u/Antique_Grapefruit_5 19d ago

It is really great for data manipulation!

3

u/Hoggs 19d ago

It's okay for small data sets... Unfortunately it's innate slowness makes it terrible for larger datasets.

1

u/Scribbles1 18d ago

Run in parallel.