r/PowerShell • • Sep 17 '21

Question Why do Powershell cmdlets change so much?

I've been trying to follow along a month of lunches, and quite a few commands can't be used anymore. How is one supposed to follow along?

Why do they keep changing them?

Won't this mess up people's scripts that they've written before? When are they going to stop changing them.. and why do they change them? Makes me a bit worried.

I want to master Powershell, but if the cmdlets keep changing, wtf?

Thanks.

1 Upvotes

22 comments sorted by

View all comments

3

u/Thotaz Sep 17 '21

Microsoft focuses a lot on avoiding breaking changes, to the point where it hurts PowerShell a little bit. Look at a cmdlet like Join-Path, it started out with a "Path" and "ChildPath" parameter and then they later added an "AdditionalChildPath" parameter instead of updating the "ChildPath" parameter to be a string array.

Anyway, I'm sure there are some edge cases that have been broken but for the most part scripts written in older versions will work just fine in newer versions. You will have to name explicit examples if you want to know more.

2

u/Reddit_Sux_Hardcore Sep 17 '21

Ok, I'll keep learning and see how it goes.

My buddy who writes in PHP said it's been around for awhile, so things don't change that much, as opposed to Powershell which is still in its infancy, he said.

5

u/nealfive Sep 17 '21

PHP was released around 1994 and PowerShell around 2006, so it has a few years on powershell.

Windows PowerShell 5.1 and PowerShell (6/7) are fundamentally different and Windows PowerShell (5.1) is .NET based and PowerShell (6/7) is .NET Core based which also works on Linux and such.

Windows PowerShell (5.1) is considered 'complete' and all new development goes into PowerShell (6/7)

All the commands in Don's book should work just fine Windows PowerShell (5.1) as that's what it was written for, yes the latest edition of the book has more stuff to accommodate more to 7 but still, most stuff is for Windows PowerShell,rather than powershell.

It's a bit like Python 2 and 3. While mostly the same, they are still pretty different.