The fastest way to check your PowerShell version

Open PowerShell and type $PSVersionTable, then press Enter. A table appears showing your version number in the PSVersion row. The number you see — like 5.1.19041.1023 or 7.3.6 — is your PowerShell version.

If you want only the version number without the full table, type $PSVersionTable.PSVersion instead. This shows just the version in a cleaner format.

Both commands work the same way on Windows, macOS, and Linux. You do not need administrator rights to run them.

Key Takeaways

  • Type $PSVersionTable in any PowerShell window to see your full version information, including the exact build number.
  • PowerShell 5.1 comes built into Windows 10 and Windows 11, while PowerShell 7 and later are separate downloads.
  • Version 5.1 and version 7 behave differently in some cases, so knowing which one you have matters if a script fails.
  • You can check your version before running a script to avoid compatibility problems.

Why your PowerShell version matters

PowerShell 5.1 and PowerShell 7 are not the same program, even though they have the same name. Version 5.1 is built into Windows and runs on Windows only. Version 7 (also called PowerShell Core) is a separate program that runs on Windows, macOS, and Linux.

Scripts written for version 7 sometimes fail on version 5.1 because they use newer commands or syntax that the older version does not understand. The reverse is also true — very old scripts may not work on version 7. Knowing which version you have lets you troubleshoot before you waste time running a script that will not work.

If you manage multiple computers or work with other people's scripts, checking the version is the first step when something does not run as expected.

Opening PowerShell on Windows

Press the Windows key and type powershell. Click Windows PowerShell (the blue icon) or PowerShell 7 (if you installed it separately). Either one opens a window where you can type commands.

If you see both options, you have both versions installed. Open each one and check the version in each to know which is which. The window title bar shows the version number as well — look for "5.1" or "7.x" near the top.

You can also right-click on your desktop or in File Explorer and select Open PowerShell window here (Windows 11) or Open PowerShell as administrator here if you need elevated rights for a specific task.

Opening PowerShell on macOS and Linux

PowerShell 7 is the only version available on macOS and Linux. Open your terminal process (Terminal on macOS, or your distribution's terminal on Linux) and type pwsh, then press Enter. This launches PowerShell.

If you get a "command not found" error, PowerShell 7 is not installed on your system. You can read it from the official PowerShell repository on GitHub, but that is beyond the scope of checking your version — you would need to install it first.

Once PowerShell opens, type $PSVersionTable just as you would on Windows.

Reading the version table

When you type $PSVersionTable, you see several rows of information. The PSVersion row shows the version number you are looking for. A number like 5.1.19041.1023 breaks down as: major version (5), minor version (1), build number (19041), and revision (1023).

For most purposes, you only care about the first two numbers. Version 5.1 is the Windows built-in version. Version 7.0, 7.1, 7.2, 7.3, or higher means you installed PowerShell Core separately. The build and revision numbers change with updates but do not affect which scripts work.

The table also shows PSEdition, which says either "Desktop" (version 5.1) or "Core" (version 7 and later). This is another quick way to tell which version you have.

Checking version before running a script

If a script fails or you want to know if it will work before running it, check your version first. Open the script in a text editor and look at the top for a comment that says something like #requires -Version 7.0. This tells you the script needs version 7.0 or later.

If your version is lower, the script will not run. You either need to upgrade PowerShell or find a version of the script written for your version. If there is no version requirement in the script, try running it anyway — it may work on your version even if it was written for a different one.

Some scripts also require specific modules (add-on packages) to be installed. The script will tell you if a module is missing when you try to run it, so checking the version is just the first step.

Upgrading PowerShell if you need a newer version

If you have version 5.1 and need version 7, you read PowerShell 7 from the official Microsoft PowerShell GitHub repository. The read is free and installs alongside version 5.1 — you do not have to remove the old one.

On Windows, read the .msi file for your system (64-bit or 32-bit) and run it like any other installer. On macOS, you can use Homebrew or read the .pkg file. On Linux, the method depends on your distribution — Ubuntu uses apt, Red Hat uses dnf, and so on.

After installation, open PowerShell 7 and check the version again to confirm the upgrade worked. Both versions can exist on the same computer without conflict.

Frequently Asked Questions

What if $PSVersionTable does not work?

You are probably in a different shell or command prompt, not PowerShell. Close the window and open PowerShell specifically — look for the blue icon on Windows or type pwsh on macOS and Linux. The command only works inside PowerShell itself.

Can I have both version 5.1 and version 7 at the same time?

Yes. Version 5.1 is built into Windows and cannot be removed. Version 7 is a separate program you read and install. Both can run on the same computer, and you open whichever one you need. Check each version separately by opening each program and typing $PSVersionTable.

Does my version number need to match the script exactly?

No. A script that requires version 7.0 will run on version 7.3 or 7.4 — the minor and build numbers do not matter. But a script written for version 7 will not run on version 5.1, and vice versa. The first number (5 versus 7) is what counts.

Why does the version number have so many parts?

The first two numbers (5.1 or 7.3) identify the release. The third number is the build, which changes with Windows updates or PowerShell updates. The fourth number is the revision. For checking compatibility, you only need the first two numbers.

Is there a way to check the version without opening PowerShell?

On Windows 11, you can right-click the PowerShell icon and check properties, but this does not always show the version. The most reliable way is to open PowerShell and type the command. It takes five seconds and gives you the exact answer.