To check the PowerShell version, simply type Get-Host or the built-in alias $PSVersionTable in the terminal and press Enter. This command returns a table with the exact build number, edition (Core or Desktop), and major version (e.g., 5.1, 7.x) running on your system. You can run this from the Start menu search, Windows Terminal, or any standard command prompt window.

What You'll Need

Technically, you need nothing more than a standard Windows installation running PowerShell. However, the experience and the commands available differ significantly depending on your version, so knowing what you have is the first step in troubleshooting or configuration. Ensure you are using a standard user account or an administrator account with standard command-line access; elevated privileges are not required to view version information.

  • A computer running Windows 10 or Windows 11.
  • Access to the Start menu or a command-line interface (CLI).
  • Basic understanding of command syntax (typing commands and pressing Enter).

Step-by-Step

Below are the specific methods to check your version. The method you choose depends on whether you want a quick summary or detailed information for compatibility checks.

  1. Open the Terminal: Click the Start button and type PowerShell or Windows Terminal. Select the application from the list. If you are using Windows 11, the search bar will show a terminal icon directly in the results. For older versions, you may need to open the Command Prompt first and type powershell to launch the interpreter.
  2. Verify the Host Environment: Once the window opens, you will see a blue or white prompt. Type the following command and hit Enter: Get-Host

    This command queries the host application (the window you are typing in) for its version details. The output will list the Version, Name, and Id of the host. This is useful for distinguishing between the Windows PowerShell host and the newer PowerShell Core host.

  3. Check the Detailed Version Table: For a comprehensive list of all version-related properties, use the automatic variable $PSVersionTable. Type the following command and press Enter: $PSVersionTable

    This command does not require a module import and is available immediately upon launching the session. It provides a read-only hash table containing the PSVersion, PSEdition (e.g., Desktop, Core), Build, CLRVersion, and GitCommitId (if installed from source). This is the most reliable method for determining compatibility.

  4. Interpret the Output: Look for the PSVersion property. If you see 5.1.22621, you are running Windows PowerShell 5.1, which is included with Windows 10 and 11. If you see 7.2.x or higher, you are running PowerShell 7 (Core), which is a cross-platform version updated annually.

  5. Check Edition Differences: Note the PSEdition property in the output. Desktop editions run on the .NET Framework (Windows-only) and include legacy modules. Core editions run on .NET 6/7/8 and are cross-platform but may lack modules specific to older Windows management tools.

Common Mistakes

Users often confuse the host version with the CLR (Common Language Runtime) version or misread the edition type, leading to incorrect assumptions about module compatibility.

  • Confusing Host and CLR: When using Get-Host, the Name might say ConsoleHost even if it is PowerShell 7. The Version inside this object refers to the host application, not the PowerShell engine itself. Always check $PSVersionTable for the precise engine version.
  • Misreading the Edition: A system running PowerShell 5.1 on Windows 11 will show PSEdition: Desktop. A system running PowerShell 7 will show PSEdition: Core. Installing PowerShell 7 alongside Windows PowerShell does not change the Windows PowerShell edition; it installs a separate application.
  • Ignoring the Build Number: Simply knowing you have version 5.1 is not always enough. Microsoft releases monthly updates (LTSB - Long Term Servicing Branch). If you see 5.1.19041 vs 5.1.22621, the latter is significantly newer and contains critical security patches. Always look at the full build number for accurate system health assessment.
  • Running the Wrong Command: Do not type version or psversion. These are not valid PowerShell commands. The correct syntax is either $PSVersionTable or Get-Host. Typing invalid commands will result in a CommandNotFoundException error.

Tips

  • Use Aliases for Speed: You can create a shortcut alias for the version table to type less. Run Set-Alias -Name pv -Value $PSVersionTable (the alias name is arbitrary). Then, you can simply type pv to see the table.
  • Save to File: If you are troubleshooting for a colleague, you can save the output to a text file to share. Type $PSVersionTable | Out-File -FilePath version.txt. This creates a text file in your current directory containing the version data.
  • Check for Updates: If you are running PowerShell 5.1 and see the version is older than 5.1.19041, you likely need to install the latest cumulative update for Windows. For PowerShell 7, the command winget upgrade --id Microsoft.PowerShell will keep your installation current.
  • Distinguish PowerShell vs. Windows Terminal: Windows Terminal is a shell that hosts PowerShell, Command Prompt, and other shells. The version command checks the shell *inside* the terminal. If you have a very new version of Windows Terminal but an old version of PowerShell, the output will reflect the old PowerShell version, not the terminal version.

Troubleshooting

If the commands do not work or the output seems incorrect, follow these steps to resolve the issue.

  1. Restart the Application: Sometimes the process can hang or display cached data. Close the terminal window completely and reopen it. This clears the session and ensures you are launching the latest available version of the executable.
  2. Verify Installation: If you are expecting PowerShell 7 but see PSEdition: Desktop, verify that the PowerShell 7 installer was run successfully. For Windows 10 1809 and older, PowerShell 7 is an add-on. For Windows 11 and Windows 10 2004+, it is built-in but the separate Core edition is often installed separately for features like Docker support.
  3. Check for Corrupted Profiles: If $PSVersionTable returns an error (e.g., Access to the path is denied), your PowerShell profile might be corrupted or locked. Rename your profile file (usually located in $HOME\Documents\WindowsPowerShell or $HOME\Documents\PowerShell) to profile.old to bypass it and check if the command works. If it does, the issue was in your custom configuration scripts.
  4. Run as Administrator: While viewing the version usually does not require admin rights, some security policies (like AppLocker or Software Restriction Policies) might block non-administrative users from running certain PowerShell hosts or modules. If the command fails, try running the terminal as Administrator to see if permissions are the issue.

Frequently Asked Questions

What is the difference between PowerShell 5.1 and PowerShell 7?

PowerShell 5.1 is the legacy version bundled with Windows 7, 8, 10, and 11. It relies on the .NET Framework. PowerShell 7 is a completely rewritten version built on .NET 6/7/8, offering cross-platform support (Linux, macOS) and modern language features like Unicode support and regex improvements.

Why does my command work in PowerShell 7 but not 5.1?

PowerShell 7 introduces new cmdlets and syntax. For example, Get-ChildItem is aliased to ls, which works in both. However, newer modules like PSReadLine or PSGet have different implementations. If a script fails in 5.1, it may be because a specific module used in the script is not available in the Desktop edition.

How do I update PowerShell to the latest version?

For Windows 10 version 2004 and later, or Windows 11, the easiest way is to use the Microsoft Store or the winget package manager. Run winget upgrade --id Microsoft.PowerShell in a terminal. For older versions, you must download the MSI installer from the official GitHub repository or use the Windows Update mechanism to get the latest cumulative update for the OS.

Can I run a script written for PowerShell 7 on Windows PowerShell 5.1?

Generally, no. While basic syntax is often compatible, many modern features (like structured error handling, module imports, and language constructs) are not backward compatible. If you are developing scripts for a mixed environment, you must target a specific version or use compatibility layers if supported.

Does the version command show if I have administrative privileges?

No. The $PSVersionTable and Get-Host commands only report the software version. To check your permissions, you would need to run a command like whoami or net session, or look at the prompt prefix (usually # for admin and $ for user).

What does PSEdition: Core mean?

This indicates that the PowerShell engine is running the cross-platform edition. This edition is designed to work on Windows, Linux, and macOS. It does not mean you are running on Linux; it simply means you have installed the version of PowerShell that is capable of running on any supported operating system.