Overview of PowerShell versions and how to check what version you have?

PowerShell is one of the most popular scripting languages and it is installed by default on all Windows operating systems starting from Windows 7 SP1. It consists of a Command Line Interface (CLI) and pre-programmed .NET classes called cmdlets, where each cmdlet performs a specific function.

Over the years, PowerShell’s capabilities have increased and these are reflected in its many versions. 

In this article, we will take a detailed look at the evolution of PowerShell and what has changed in each of these versions. We follow this up with step-by-step instructions on how you can check the version you have. 

PowerShell Versions

PowerShell was first launched at the Professional Developers Conference that took place in Los Angeles in October 2003. Since then, there have been nine versions, but the good news is all versions are backward compatible, which means, you can install the later version of Windows PowerShell on older Windows computers.

Let’s now look through the features of each version.

PowerShell Version 1.0

This was the first version that works on Windows XP SP2, Windows Server 2003 SP1, and Windows Vista. It was also a component of Windows Server 2008. 

This was a fairly basic version that allowed users to get and set values with about 129 cmdlets.

PowerShell Version 2.0

The second version was a big jump over this first one as it had more than 632 cmdlets that reduced the amount of code required for executing a task. A significant improvement in this version was the breakpoints that made it easy to debug the script. Eventing, advanced features, remote management, background jobs, and a GUI-based PowerShell host were the other significant features in this PowerShell version.

It was released for Windows 7 and Windows Server 2008 R2

PowerShell Version 3.0

From this version on, PowerShell was integrated with the Windows operating system. It was shipped with Windows 8 and Windows Server 2012. Microsoft also offered this version for Windows 7 and Windows Server 2008 with service packs.

A salient feature of this version was that PowerShell became a part of the Windows Management Framework that has the WinRM service for remote management of devices. From this version, you can schedule jobs using the Windows Task Scheduler. 

Session connectivity, automatic module detection, and new cmdlets are the other highlights.

PowerShell Version 4.0

This version was shipped with Windows 8.1 and Windows Server 2012 R2.

It came with more features such as enhanced debugging, network diagnostics, and support for the Where and ForEach loop.

PowerShell Version 5.0

This version was released with Windows 10 and it supported object-oriented programming, as you can use the “class” keyword for programming. It included enums, OneGet, and more.

It supported Desired State Configuration (DSC) and Local Configuration Manager (LCM) along with their resources and partial configurations.

PowerShell Version 5.1

This version was released with Windows 10 Anniversary Update. 

A salient aspect of this PowerShell version is that it comes with two editions – one for Desktop and the other for Core. The Desktop edition is a continuation of the traditional PowerShell editor while the Core edition runs only on .NET core and comes bundled with Windows Server 2016.

Another notable aspect is this was the last version made exclusively for Windows.

PowerShell Core 6

From this version, PowerShell has become a cross-platform, free, and open-source platform. It can be used on Windows, macOS, and Linux with no modifications whatsoever. 

This version is compatible with around 2000 existing cmdlets on Windows 10 and Windows Server 2019. Though it worked well on Linux, it was not well-received by Windows users.

Hence, Microsoft came up with minor upgrades and versions to enhance user experience, make improvements, and fix bugs.

PowerShell 7

This version was designed to replace PowerShell 5.1 as the de facto version on Windows. 

Some of its new features include pipeline and search operators, cmdlets, and improved compatibility with other built-in modules.

As you can see, PowerShell has evolved from a simple scripting tool to an advanced cross-platform tool that empowers users to automate tasks and through it, improve their productivity with reduced effort. 

Checking the PowerShell Version You Have

There are many ways to check which PowerShell version is installed in your system, so you can know if a particular feature is available or not.

PowerShell Version Using the Host Command

One of the easiest options is to use the “Host” command.

Open your command line and type “host” and this will list all the details about your PowerShell. 

Look for the version information. This example has PowerShell version 5.1.

PowerShell Version Using $PSVersionTable Variable

The second option is to use a built-in variable called $PSVersionTable.

This variable checks the PowerShell Core’s version.

You can also use this variable to know just the major version of the installed PowerShell version.

To do this, use the command

$PSVersionTable.PSVersion.major

In this example, this command returns the value “5”.

PowerShell Version Using Registry Value

You can also use the registry variable “HKLM\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine” to know the PowerShell version installed in your system. 

Here, you have two choices. You can either navigate to the registry through Windows Explorer and access the value of this registry variable or you can use PowerShell’s “Get-ItemProperty” cmdlet to get this value.

In the above example, use Get-ItemProperty \Windows\System32\Microsoft\PowerShell\v1.0\PowerShellEngine

This is the installed path of PowerShellEngine in this system. Change the path according to your setup. This works well in Windows 8 and Windows Server 2012 and higher versions.

For earlier versions, use the -Path parameter.

Get-ItemProperty -Path \Windows\System32\Microsoft\PowerShell\v1.0\PowerShellEngine

The other way is to open the Windows Registry and check the associated value.

Checking PowerShell Version in Remote Computers

PowerShell makes it easy to check the PowerShell version on remote computers as well.

You can use the “Invoke-Command” cmdlet to access this version number.

Invoke-Command -ComputerName comp1 -ScriptBlock {$PSVersionTable.PSVersion} -Credential $cred

This command will run the $PSVersionTable.PSVersion command in the remote computer called comp1 after logging in with the value of $cred.

You can also extend this command to check from multiple remote computers. Send an array of values if you need to get this information from many computers. You can also separate the values with commas and pipe them to the “Invoke-Command” cmdlet. 

Just make sure to print the computer name, so you know which computer has what version.

Thus, these are different ways to check the PowerShell version installed in a system.

Final Thoughts

To conclude, PowerShell is a built-in ubiquitous scripting language. Its versatility and ease of use make it a popular option for automating configuration and maintenance tasks.

Due to this popularity, Microsoft has added more features to PowerShell, and the result is about nine versions since the first was released in October 2003. Each of these versions is backward compatible as well.

Undoubtedly, the higher versions have more capabilities, and we hope the comparison of versions in this article will help you to know what’s currently available and which ones you must install for the capabilities you need. 

Lastly, we show the different ways by which you can check the current version installed in your system. 

We hope this was an interesting read. Please share if you know other ways to check the PowerShell version installed in your system.

Leave a Comment

Your email address will not be published.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top