How to Check the PowerShell Version (including 6.x & 7.x)

HK SharePoint Admin
3 min readOct 6, 2021

If you googling for “how to check powershell version” you will not get the most updated and accurate answer. Those websites suggest open the PowerShell command console and run $PSVersionTable to get the version. However, in this way you will not aware PS6/7 is also installed.

It is because PowerShell v6.x & v7.x are something new and separated from original PowerShell 5.x. It is completely possible that you have installed both PS5 and PS7 on same Windows server or PC.

In below screenshot I opened the command console of PS5 and PS7 on same Win2016 server. You should consider PS6/7 are new program. They are not an upgraded version of original PS5.

Windows PowerShell 5.1 is built on top of the .NET Framework v4.5. With the release of PowerShell 6.0, PowerShell became an open source project built on .NET Core 2.0. PowerShell 7.0 is built on .NET Core 3.1. And, with the release of PowerShell 7.2, PowerShell will be built on .NET 6.0. Moving from the .NET Framework to .NET Core allowed PowerShell to become a cross-platform solution. PowerShell runs on Windows, macOS, and Linux. (Microsoft reference)

Normally you will not get into above situation because PS6/7 is not installed by default. Also, at the moment of writing there is no news Windows 11 will have PS7, too.

But in some cases, for example, your teammate install it without telling you, or you just join a new company. It is always better to double check. In my case, our cybersecurity team require us upgrade PS7 because vulnerability was found is PS7. It is my job as system administrator to make sure PS7 is updated.

How to verify PS6/7 is installed?

Now you know PS6/7 are separated program from PS5. Below are the method to verify whether PS6/7 is installed.

  • Environmental Path
    After install PS6/7, new environmental path will be added:
    PS6: C:\Program Files\PowerShell\6\
    PS7: C:\Program Files\PowerShell\7\
    In DOS prompt, type “path” to return current environmental path.
  • Call PS6/7 by command
    Since environmental path is added, you can simply call PS6/7 by type in “pwsh” to call PS6/7. Type “powershell” to call the old PowerShell.
  • Check registry
    PS6\7 add registry into below path:
    HKLM\Software\Microsoft\PowerShellCore\InstalledVersions\<GUID>
    Old PS have registry in below path:
    HKLM\Software\Microsoft\PowerShell\
  • Find in Windows start menu
    Some website recommend look for PowerShell in start menu which is inaccurate because PS7 could not be found. You need to look for PS6/7 under “P” entries. See screenshots below:
Unable to locate PS7 in start menu search
Instead, you have to look for it under “P” entries

--

--