How to check the Powershell version you’re using?

Discovering Your PowerShell Version: A Step-by-Step Guide to Checking Your PowerShell Version

Sign Up for Superops.ai

Microsoft introduced PowerShell in 2006, and since then it has been an indispensable tool for IT professionals and MSPs to automate administrative tasks, and manage systems. Until 2016, PowerShell was only accessible on Windows systems. After its launch as an open-source, cross-platform language—PowerShell Core; has become even more popular. You can now install PowerShell on macOS, Linux, and other operating systems and use it to manage multiple ecosystems and large networks. It works seamlessly with popular technologies like Azure, Exchange, SQL, and other third parties like AWS, VMWare, Google Cloud, etc. 

The use of PowerShell has increased since the Windows era. PowerShell is an enhanced version of Command prompt and is significantly more powerful. It provides users with not just an interactive interface, but also a user-friendly script language. Today, Powershell offers so many advanced features, functions, and modules that the possibilities of what you can do with it are limitless. You can automate tasks, access data faster, perform remote operations, and manage multiple cloud solutions.

Why should you know which Powershell version you’re using?

Ever since its inception, PowerShell has gone through multiple iterations. The most recent one is PowerShell 7.2. Until version 5.1 (released in January 2017), PowerShell was exclusive to Windows and popularly known as Windows PowerShell. It was built on top of the .NET Framework. The earlier versions of Windows PowerShell were 1.0, 2.0, 3.0, 4.0, and  5.0.

In 2018, PowerShell Core 6.0 was launched, a significant milestone for Microsoft as it was cross-platform, open-source, and built for heterogeneous environments and the hybrid cloud. 

Not all versions of Powershell work the same. For example, In Version 7.2, you can install updates via the Microsoft Updates services, which had been missing since PowerShell 6.0. More importantly, the PowerShell version that you have installed determines what cmdlets and functions you can use. The newer versions often support cmdlets and syntax rules that are simply not available in the older versions. 

That’s why it is crucial to know what Powershell version you have. But how to find out what version you have installed?  There are four common ways to discover the PowerShell version you are using. Let’s explore what they are.

Which PowerShell version is supported by which Windows OS?

Here is a table that will give you a quick overview of the different Powershell releases and what versions of PowerShell come pre-installed with your Windows operating system.

PowerShell Version

Release Date

Supported by Default

PowerShell 1.0

November 2006

Windows Server 2003 SP1, 

Windows XP SP2, and Windows Vista.

PowerShell 2.0

October 2009

Windows Server 2008 R2 and Windows 7

PowerShell 3.0

September 2012

Windows 8 and Windows Server 2012

PowerShell 4.0

October 2013 

Windows 8.1 and Windows Server 2012 R2

PowerShell 5.0

February 2016 

Windows 10 and Windows Server 2016

PowerShell 5.1

January 2017

Windows 10 anniversary update and Windows Server 2019

Powershell 6.0

January 2018

Windows 10, Windows 8.1, Windows 7 with Service Pack 1, Windows Server 2012 R2, Windows Server 2012 and Windows Server 2016.

How to check your PowerShell version?

First, let’s launch PowerShell, and then look at each of the below commands one by one. 

It's straightforward, just look for Windows Powershell using the Search bar and click on the app. A black will window will open up where you can type in your commands. 

power 1.png

1. The Get-Host command

You can type in the Get-Host command to find out the version of PowerShell you’re using. This is known to be the primary command in Powershell. 

Before we find out what’s the version number, let’s quickly understand what is a host in the Get-Host command. In Powershell, a host is a program hosting the PowerShell engine. So, ideally, the Get-host command returns the version of the host. It’s not the version of PowerShell. That’s why this command is said to be inaccurate. Oftentimes, it happens that the version of Powershell matches the version of these Hosts. 

This command also displays information such as the name of the host, current culture, and UI culture.

Another point to note here is that this cmdlet does not work remotely. It always returns version 1.0.0.0. Even on Windows Server 2022

The version mentioned in the below screenshot is 5.1.22621.608

power 2.png

2. The $host.Version command

If you run (Get-Host).Version, you will see that it returns a number similar to the one we got with the Get-Host command.

power - 3.png

3. The $PSVersionTable command

This is known to be the most reliable method to identify the PowerShell version running in your system. It's simple just type in $PSVersionTable in your command prompt and press Enter. You’ll see a list of information displayed as shown in the below screenshot. The first on the list will show you the PowerShell version. In this case, it is 5.1

The $PSVersionTable is a read-only automatic variable that returns information specifically about the PowerShell engine version. It also displays the edition—Core or Desktop, defining the edition of PowerShell that is running on your system. You can use this automatic variable on a remote computer as well.

power 4.png

4. The registry 

As the name suggests, you can use the Registry Editor to find the version of the PowerShell on your system. There are certain times when this method comes in handy. There are two ways in which you can do that. One is to type in a particular command which uses the ‘Get-ItemProperty’ and the other is to open the Registry Editor app and find the PowerShell version.

Let’s check out the first one. It is quick and easy. Just type in the below-given command.

(Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine -Name 'PowerShellVersion').PowerShellVersion

power - 5.png


For the next method, you need to open the Registry Editor app. You will then be prompted as to whether you want to allow the editor to make changes to your machine. Click on Yes. Now a Window will appear where you have to search for PowerShell under the Software folder. This is how you can do that.

  1. First, click on software under HKEY-LOCAL-MACHINE, or HKLM folder.

  2. Next, scroll down and search for Microsoft in the list of software vendors.

  3. Click on the Microsoft folder and search for PowerShell.

  4. There’ll be two folders(1 and 3) under PowerShell, click on 3.

  5. Then click on PowerShell Engine. 

  6. On the right-hand side, you’ll see a list of information including the PowerShell version number.

power - 6.png


power 7.png


power - 8.png

How to check your PowerShell version on a remote computer?

You can again use the $PSVersionTable automatic variable to determine the PowerShell version on a remote computer. You need to use the below-given Invoke-Command cmdlet where you can edit the ComputerName with your specific computer name.

Invoke-Command -ComputerName incorp-eu-101 -ScriptBlock {$PSVersionTable.PSVersion}

How can I install the latest version of PowerShell?

There are a few ways in which you can upgrade to the latest version of PowerShell. You need to choose the one that works best with your work scenario. 

1. Mircosoft Store

The most easiest method to install Tthe latest version of PowerShell (PowerShell 7.3) is to download it from Microsoft Store. Just click on Developer tools and search for PowerShell. And, click on Get in Store app. By downloading PowerShell this way, you don’t have to fret about updates. It’ll be done automatically.

power 9.png



2. Winget 

⁠This is known to be the fastest way to install the latest version of PowerShell. But, what is Winget?  Winget, also known as the Windows Package Manager, is a command-line tool enables users to discover, install, upgrade, remove, and configure applications on Windows client computers.  It is the client interface to the Windows Package Manager service.

You can use the following commands to install PowerShell.

winget search Microsoft.PowerShell

power 11.png


3. Installing the MSI package

You can install PowerShell from Github too. You can either use the following links to download the  package directly or get it from the GitHub release page.

Choose the operating system that you want to download it for.

It will take a while to download it. Once it is downloaded, follow the installer instructions and execute it.

We hope this article has been helpful in learning a bit about PowerShell and the various methods for determining which version of it is running on your computer. Overall, PowerShell is known to be a versatile and powerful application among IT users. Today, PowerShell is used for conducting remote sessions, managing and administering Azure resources,building a Continuous Integration/Continuous Deployment (CI/CD) pipeline, and enabling the automation of Exchange administration tasks  If you’re looking at installing the latest version of PowerShell, please note that you can run both Windows PowerShell and Powershell 7.3 on the same computer. 

If you have any questions or comments, please feel free to leave a comment below. Thank you for reading!


0

Try the Next-Gen RMM and PSA software for Modern MSPs

1

Simplify your MSP’s operations. Request a demo of our unified RMM and PSA solution today.

Stay in the know!

The argument for using PowerShell in your RMM scripting

The argument for using PowerShell in your RMM scripting

read more
5 PowerShell best practices to boost your MSP operations

5 PowerShell best practices to boost your MSP operations

read more
6 easy PowerShell scripting tips for MSPs to write better code

6 easy PowerShell scripting tips for MSPs to write better code

read more