DEV Community

Vigneshwaran Vijayakumar for Winsides

Posted on • Originally published at winsides.com on

How to Check PowerShell Version on Windows 11?

Check PowerShell Version on Windows 11 : Windows PowerShell is a c ommand-line shell and scripting language built on top of the .NET Framework. Unlike the Command Prompt, PowerShell allows users to automate tasks, manage system configurations, and control Windows more effectively. The Automation in Windows PowerShell is extensive , supporting scripts , Loops, Functions, and Modules. Microsoft initially introduced it as Monad in its beta phase, which later became Windows PowerShell 1.0 on its 2006 official launch.

Why Should you Check your PowerShell Version on Windows 11?

Check your PowerShell Version on Windows 11
Check your PowerShell Version on Windows 11

Different PowerShell Versions support different cmdlets , exhibit scripting capabilities , and provide security updates. For example, Windows 11 is pre-installed with PowerShell 5.1, which is compatible only with Windows. All of its cmdlets, modules, and scripts are designed for the Windows Ecosystem , whereas the latest Windows PowerShell Version 7 and above have cross-platform ability , and it allows users to run PowerShell 7 and above on other operating systems such as Linux and macOS.

Additionally, PowerShell Version 5 receives only legacy security updates , whereas PowerShell 7 receives frequent security patches , performance improvements , and bug fixes. Each version has its own advantages and disadvantages, and in this article, let’s discuss them in detail. Let’s get started.

Different Methods to Check PowerShell Version on Windows 11

To determine which version of Windows PowerShell you are using, you can either use Windows PowerShell or you can use outside PowerShell methods.

  • Check PowerShell Version using PowerShell Commands
  • Get PowerShell Version outside Windows PowerShell

How to Determine PowerShell Version using PowerShell Commands?

In PowerShell, you can use various commands to get the PowerShell Version. The following are the steps.

  • Firstly, let’s open Windows PowerShell using the Run Command. We can use the keyboard shortcut Win Key + R.
  • In the Run, execute the following command to open Windows PowerShell. powershell

Open PowerShell using the Run Command
Open PowerShell using the Run Command

  • The Run command will open PowerShell on Windows 11.
  • In PowerShell, we can use the following commands to determine PowerShell Version on Windows 11.

#1 Using $PSVersionTable

  • Execute the command $PSVersionTable in Windows PowerShell.

Recommended Command to check PowerShell Version on Windows 11
Recommended Command to check PowerShell Version on Windows 11

  • This command will display the following information, including the PowerShell Version on Windows 11.

PowerShell Version on Windows 11
PowerShell Version on Windows 11

| Name | Value | Description |
| PSVersion | 5.1.26100.6682 | The main PowerShell Version is 5.1. Here, the 5 indicates the Major Version Number, 1 indicates the Minor Version Number, 26100 indicates the Build, and finally, 6682 corresponds to the Revision Number. |
| PSEdition | Desktop | Indicates the Edition |
| PSCompatileVersions | {1.0, 2.0, 3.0, 4.0…} | Lists all PowerShell versions compatible with this installation. Shows which older scripts/modules are supported. |
| BuildVersion | 10.0.26100.6682 | The Windows build version associated with this PowerShell installation. Useful for troubleshooting and updates. |
| CLRVersion | 4.0.30319.42000 | Common Language Runtime Version. The version of the .NET Common Language Runtime that PowerShell is using. Affects which .NET features and libraries are available in scripts. |
| WSManStackVersion | 3.0 | Version of the WS-Management stack , which handles remote management using Invoke-Command or Enter-PSSession. |
| PSRemotingProtocolVersion | 2.3 | Version of the protocol PowerShell uses for remoting commands between computers. Ensures compatibility between systems. |
| SerializationVersion | 1.1.0.1 | Version of the serialization method used to convert objects for remoting or exporting. Critical for passing objects across sessions or machines. |

Note : If you only want to see the PowerShell version, then you can use the following command in the PowerShell $PSVersionTable.PSVersion. This command will precisely provide the determined PowerShell Version and related information. Kindly refer to the following image.

Command to get detailed PowerShell Version on Windows 11
Command to get the detailed PowerShell Version on Windows 11

  • With the above command, only the essential information, such as Major Version, Minor Version, Build, and Revision Number, will be displayed.

#2 Get PowerShell Version using the Get-Host Command

The Get-Host Command on Windows PowerShell provides information about the Console Host. The information is not related to the detailed PowerShell Version, however, we will get the PowerShell Version here.

  • To get the PowerShell Version using the Get-Host command, please execute it in PowerShell.

Execute Get-Host Command in the PowerShell
Execute the Get-Host Command in PowerShell

  • The output will have the following information. Name , Version , InstanceID , UI , CurrentCulture , CurrentUICulture , Private Data , Debugger Enabled , IsRunspacePushed , Runspace. Here, the version determines PowerShell Version.

Check PowerShell Version using Get-Host Command
Check PowerShell Version using the Get-Host Command

#3 Determine PowerShell Version Directly using $host.version

This command provides straightforward output similar to $PSVersionTable.PSVersion.

  • Execute the following command in PowerShell. $host.version

Check PowerShell Version using host.version
Check PowerShell Version using host.version

  • The output will contain the following information. Major Build Number, Minor Build Number, Build Version, and Revision Version.

Check PowerShell Version on Windows 11
Check PowerShell Version on Windows 11

  • I am currently running Windows PowerShell 5.1.26100.6682.

How to Determine PowerShell Version Outside of PowerShell?

Alright, the above methods explain how to check PowerShell Version using Windows PowerShell itself. Here, we can check how to check the Windows PowerShell Version outside of PowerShell, such as the Command Prompt and Registry Editor.

Get PowerShell Version using Command Prompt:

  • Go to the Run and open Command Prompt using the following command. cmd
  • In the Command Prompt, kindly execute the command powershell -Command "$PSVersionTable.PSVersion"

CMD Command to check PowerShell Version
CMD Command to check PowerShell Version

  • Now, the Command Prompt will display the PowerShell Version. In my case, I am on PowerShell 5.1.26100.6682.

Command Prompt displaying PowerShell Version on Windows 11
Command Prompt displaying PowerShell Version on Windows 11

How to Check Windows PowerShell Version on Windows 11 using Registry Editor?

  • To open the registry editor on Windows 11, we will use the Run Command.
  • In the Run, execute the command regedit

Open Registry Editor using the Run Command
Open Registry Editor using the Run Command

  • The User Account Control will confirm and open Registry Editor.
  • Navigate to the following path in the Registry Editor. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine

Navigate to the following path
Navigate to the following path

  • Once you navigate to the above path, you can find the file “ PowerShellVersion “. You can view the version next to it.

Locate PowerShell Version File
Locate PowerShell Version File

  • You can also open it to view the PowerShell Version. That’s it.

PowerShell Version on Windows 11 using Registry Editor
PowerShell Version on Windows 11 using Registry Editor

How to check the Version in the latest PowerShell 7?

Windows PowerShell 7 is the modern, cross-platform form of PowerShell. Unlike the legacy PowerShell 5, which is built into Windows 11, we have to install PowerShell 7 separately. There are different methods available to install PowerShell 7 on Windows 11, from the Microsoft Store to Winget, MSI, and more. Here, we will explain how to check the PowerShell 7 version.

Install PowerShell 7 using WinGet on Windows 11

  • Open Command Prompt, and run the following command. winget search powershell

Search for PowerShell using Winget Command
Search for PowerShell using Winget Command

  • Winget will search the Microsoft Community Repository and Microsoft Store and provide the results.
  • From the results, you can locate the official stable build and install it using the following command. At the time of this article, the latest version of PowerShell is 7.5.3.0. It is the stable and official release. Kindly note down its ID. The ID is Microsoft.PowerShell

Locate official and stable PowerShell 7 and note down its ID
Locate official and stable PowerShell 7 and note down its ID

  • Next, we will install PowerShell 7 using the following command in the Command Prompt. winget install --id Microsoft.PowerShell

Install PowerShell 7 using the Winget Command
Install PowerShell 7 using the Winget Command

  • This command will install PowerShell 7 from the official GitHub repository. The process will take some time to complete. Kindly be patient.

Install PowerShell 7 using the Winget Command
Install PowerShell 7 using the Winget Command

  • Once the package is successfully installed, you can start using Windows PowerShell 7. You can explicitly access it via the Start menu or by using the command pwsh

Note : You can also download and install Windows PowerShell 7 using the MSI installer from the official GitHub Repository.

Determine PowerShell 7 version using pwsh command

The following command will work only on the latest PowerShell 7 version.

  • In PowerShell 7, execute the following command. pwsh --version

PowerShell 7 Command to check its version
PowerShell 7 Command to check its version

  • PowerShell will display the version now.

PowerShell 7 Version
PowerShell 7 Version

Note : In PowerShell 7, other legacy methods such as Get-Host, PSVersionTable will work flawlessly. Additonally, you can get PowerShell 7 version using the following command as well. pwsh -v

Take Away

Whether you are using Legacy PowerShell 5 or the Modern PowerShell 7 , the above article covers different methods and detailed steps to check the PowerShell Version on all variations. We hope you are satisfied with our article on How to Check PowerShell Version on Windows 11 , and if you have any queries , kindly let us know in the Comments.

For more interesting articles, stay tuned to Winsides.com. Happy Scripting! Peace out!

Top comments (0)