How to Check Which Version of PowerShell You’re Running?

PowerShell is an indispensable tool for automating various tasks on Windows. With multiple versions of PowerShell available, knowing how to check your current version is useful for troubleshooting or understanding the features at your disposal.

Finding PowerShell Version
Finding PowerShell Version

There are several methods to determine the PowerShell version installed on your system. This guide will walk you through these options, so you can select the one that best fits your needs.

1. Using PSVersionTable Variable

The simplest method to find out your PowerShell version is to use the PSVersionTable variable. By accessing this variable in a PowerShell window, the current version will be displayed.

  1. Open a PowerShell window by searching for it in the Start Menu.
  2. Type $PSVersionTable into the PowerShell window and press Enter.
    Printing PowerShell Version with PSVersionTable Variable
    Printing PowerShell Version with PSVersionTable Variable
  3. Look for a table that appears, listing details including the PowerShell version.

2. Find PowerShell 7 Version

PowerShell 7, the latest version, introduces enhancements over the traditional Windows PowerShell, which is based on PowerShell 5.1.

  1. Begin by opening the Start Menu and searching for PowerShell 7. Open it.
  2. The first line in the PowerShell window will indicate the exact version.
  3. If that isn’t successful, employ the $PSVersionTable variable to find the version.
    Finding PowerShell 7 Exact Version
    Finding PowerShell 7 Exact Version

3. Using get-host Command

The get-host command is another means to identify the PowerShell version from within a PowerShell window. It retrieves information about the program hosting the PowerShell environment.

  1. Launch a PowerShell window by searching for it in the Start Menu.
  2. In the PowerShell window, type get-host and press Enter.
    Using get-host Command
    Using get-host Command
  3. The ‘Version’ information will specify the version of the PowerShell program.

4. Using $Host Variable

Yet another approach to reveal the PowerShell version is by using the $host variable, which is automatically initialized upon starting a PowerShell session.

This method provides the added advantage of displaying the version in terms of major and minor release numbers, as well as the build version. This detail can be particularly useful for troubleshooting issues in PowerShell.

  1. Access the Start Menu and search for PowerShell. Open it.
  2. In the PowerShell prompt, type $host.version and press Enter.
    Using Host Variable
    Using Host Variable

5. Check the PowerShell Version in the Windows Registry

You can also find the PowerShell version by invoking the Windows Registry. Note that the registry path may vary depending on the major version of PowerShell.

Both PowerShell 7 and 5.1 have their own respective registry directories. Here are the paths for each, but remember that future versions may have different locations.

  1. First, open the Run dialog by pressing Win key + R on your keyboard.
  2. Enter regedit in the Run dialog and press Enter.
    Opening Windows Registry
    Opening Windows Registry
  3. To find the PowerShell 5.1 version, go to:
    Computer > HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > PowerShell > 3 > PowerShellEngine
  4. In the right pane, the PowerShellVersion key will display the exact version.
    PowerShell 5.1 Version in Registry
    PowerShell 5.1 Version in Registry
  5. PowerShell 7 is found at:
    Computer > HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > PowerShellCore > InstalledVersions
  6. Select the UUID (Universally Unique Identifier) on the left inside the InstalledVersions directory.
    Clicking the PowerShell 7 UUID
    Clicking the PowerShell 7 UUID
  7. The SemanticVersion key will reveal the precise version of PowerShell 7.
    PowerShell 7 Version in Registry
    PowerShell 7 Version in Registry

Updating PowerShell

PowerShell typically receives updates through the standard Windows update process. As such, to ensure your PowerShell remains current, be vigilant in applying regular Windows updates.

Moreover, PowerShell 7 does not come pre-installed with Windows installations and must be manually installed from the official GitHub repository should you wish to utilize it on your system.

ABOUT THE AUTHOR

Kevin Arrows


Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.