I have published a new document in the wiki that covers the differences between the PowerShell versions. If you are familiar with the topic, it would be great if you would share your knowledge with the PowerShell community.
Avatar
Latest posts by Michael Pietroforte (see all)

The new document is based on a blog post I created a while ago. I updated the text and added a table that compares the available core cmdlets in the different PowerShell versions.

The PowerShell versions are backward compatible, which means that a script that you wrote for an old PowerShell version should also run in the newest release. However, problems with different PowerShell versions can come up if you work in an environment with different Windows versions but PowerShell hasn't been upgraded to the latest version.

You can use the require statement to prevent your script from running in an unsupported environment. However, you need to make sure that your script works with the cmdlets that are supported on your target machines.

You'll find a table in the wiki that tells you which PowerShell version you can expect on a Windows installation that is still in the original configuration. The second table in the wiki gives you an overview of the available core cmdlets since PowerShell 2.0.

PowerShell does come with several preinstalled modules and snap-ins that add quite a few features and cmdlets to the language. Thus far, these differences between the PowerShell versions are not covered in the wiki.

If you want to contribute to the project, you could write a PowerShell script to create the corresponding table. With the help of the Get-Command cmdlet, you could retrieve all available cmdlets on a certain installation, store the output in a text file, and then compare the result with the cmdlets on a Windows 10 installation.

Of course, it is important that you haven't installed any additional snap-ins on your test computers. You will need a Windows 7, Windows 8, Windows 8.1, and Windows 10 installation. I banned everything below Windows 8.1 from my test environment, but I hope some IT pros out there still maintain these older Windows versions.

PowerShell versions have differences beyond the available cmdlets. For instance, some cmdlets might have received new parameters in new versions. In addition other language elements and features might have been added. If you are aware of such differences, you can share your knowledge in the wiki.

Subscribe to 4sysops newsletter!

All you have to do is register and then click the edit link at the top of the document. If you create the above-mentioned comparison table and don't want to mess with HTML, you can send me the corresponding CSV file, and I will create the HTML table. Just drop me a message first. I will make sure that your contribution will be noted.

0 Comments

Leave a reply

Please enclose code in pre tags: <pre></pre>

Your email address will not be published. Required fields are marked *

*

© 4sysops 2006 - 2023

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account