The quickest way to find your PowerShell version
Open PowerShell and type $PSVersionTable, then press Enter. A table will appear showing your version number in the PSVersion row. This is the most reliable method because it shows you exactly what the system is running right now.
If you want just the version number without the full table, type $PSVersionTable.PSVersion instead. You'll see output like "5.1.19041.1320" — the first number (5.1 in this case) is your major version.
Both commands work the same way whether you're on Windows, macOS, or Linux, and whether you're using PowerShell 5.1 or PowerShell 7 and newer. The output appears instantly, so you have your answer within seconds of opening the window.
Key Takeaways
- Type $PSVersionTable in any PowerShell window to see your full version information immediately.
- The PSVersion row shows your actual version number; the first digit tells you if you're on version 5, 6, or 7.
- Windows comes with PowerShell 5.1 built in, but you may have installed PowerShell 7 (the newer cross-platform version) separately.
- Different versions have different commands and features, so knowing your version helps you troubleshoot scripts that don't work.
Why your PowerShell version matters
PowerShell 5.1 and PowerShell 7 are different enough that a script written for one may not run on the other. PowerShell 7 added new cmdlets, changed how some existing ones work, and dropped support for a few older features. If you're following instructions online and they don't work, version mismatch is often the reason.
Windows 10 and Windows 11 come with PowerShell 5.1 installed by default. If you've downloaded PowerShell separately from Microsoft's GitHub repository, you likely have PowerShell 7 (also called PowerShell Core). Both can run on the same computer at the same time, so you need to know which one you're actually using when you open a terminal.
Finding your version through the Windows GUI
If you prefer not to type commands, right-click the PowerShell window title bar and select Properties. Look at the window title itself — it usually says "Windows PowerShell" (version 5.1) or just "PowerShell" (version 7 or newer). This won't give you the exact build number, but it tells you which major version you're running.
You can also open Settings > Apps > Apps & features and search for "PowerShell". If you see "PowerShell 7.x.x" listed, you have the newer version installed. If you don't see it listed, you're using the built-in version 5.1. This method is useful if you want to confirm what's installed without opening PowerShell itself.
Understanding what the version numbers mean
PowerShell version numbers follow this pattern: Major.Minor.Patch.BuildLabel. For example, "5.1.19041.1320" breaks down as version 5, minor update 1, patch 19041, build 1320.
You only need to care about the first number most of the time. Version 5 is the older built-in Windows PowerShell. Version 7 is the newer PowerShell that runs on Windows, macOS, and Linux. Version 6 existed briefly between them but is no longer supported. If your version starts with 5, you're on the classic Windows PowerShell. If it starts with 7, you're on the modern cross-platform version.
The minor version (the second number) and patch numbers matter when you're troubleshooting specific cmdlet behavior or compatibility issues, but for most everyday tasks, knowing whether you're on version 5 or 7 is enough.
Checking version when PowerShell won't open normally
If PowerShell crashes or won't respond, you can check the version through Command Prompt instead. Open cmd.exe and type powershell -Command "$PSVersionTable.PSVersion". This launches PowerShell just long enough to print the version, then closes.
On macOS or Linux, open Terminal and run the same command. If PowerShell isn't installed on those systems, you'll get a "command not found" error, which tells you that you need to install it first. This method is also useful if you want to check the version without keeping PowerShell open.
What to do if you need a different version
If you're running version 5.1 and need version 7, download PowerShell from github.com/PowerShell/PowerShell. The installer is straightforward — it won't remove your existing version 5.1, so both will coexist on your computer.
If you have version 7 but need to use version 5.1 for an older script, you can launch the built-in version by opening Command Prompt and typing powershell (which opens 5.1) instead of pwsh (which opens 7). On Windows, version 5.1 is always available because it's built into the operating system, so you never have to uninstall anything to switch between them.
Frequently Asked Questions
Can I have both PowerShell 5.1 and PowerShell 7 on the same computer?
Yes. Windows comes with 5.1 built in, and you can install 7 separately without removing 5.1. They run independently, so you can use whichever one you need for a particular task. Type powershell in Command Prompt to open 5.1, or pwsh to open 7.
Why does my script work on one computer but not another?
Version difference is a common reason. Check the version on both computers using $PSVersionTable. If they're different, look up whether the commands in your script are supported in both versions. Microsoft's documentation lists which version each cmdlet requires.
Is PowerShell 7 better than 5.1?
PowerShell 7 is newer and runs on more operating systems, but 5.1 is still supported and works fine for most tasks. Use whichever version your scripts and tools require. There's no need to upgrade if everything you do works on 5.1.
What if $PSVersionTable doesn't work?
This command works in all supported versions of PowerShell. If you get an error, you may be in Command Prompt instead of PowerShell. Close the window and open PowerShell specifically — search for "PowerShell" in the Start menu on Windows, or launch Terminal and type pwsh on macOS or Linux.