PowerShell is Microsoft’s powerful command-line shell for managing Windows and automating tasks, and checking its version lets you confirm compatibility with tools, scripts, or updates. The command to check your PowerShell version is simple: open a command prompt or PowerShell window and run `$PSVersionTable.PSVersion`. This returns a readable breakdown of your version, including the major and minor numbers. If you’re unsure which version you’re using, this guide explains how to find it accurately, troubleshoot common issues, and act if the version doesn’t match your needs.
What You'll Need
- Access to a Windows PC with PowerShell installed (usually pre-installed on Windows 10/11 or available in Admin tools).
- A user account with administrative privileges if you need to check older versions (e.g., PowerShell 5.1).
- Optional: An admin command prompt (right-click Start > Command Prompt (Admin) if you need elevated access).
Step-by-Step
-
Open a command prompt or PowerShell window. To find the correct window:
- On Windows 10/11, press
Win + R, typepowershell, and hit Enter. This opens the default PowerShell session. - If you need admin rights, right-click the Start menu > New > Windows Terminal (Admin) or Command Prompt (Admin).
- On Windows 10/11, press
-
Run this command in the PowerShell prompt:
Get-PowerShellVersionor the classic method:$PSVersionTable.PSVersionBoth commands will display a version string likeVersion 7.3.0orMajor 5 Minor 1 Patch 22681. The first method is newer and preferred. -
If you’re unsure whether PowerShell is installed, test with:
powershellin Command Prompt. If the prompt appears, PowerShell is ready. If not, it’s not installed. -
For older versions (e.g., PowerShell 5.1), use the admin prompt:
- Open Command Prompt (Admin) as step 1 above.
- Run:
powershell.exe -Command & {$PSVersionTable.PSVersion}This checks the version even if PowerShell isn’t set as the default shell.
Common Mistakes
- Using the wrong prompt: If you run the command in Command Prompt (not PowerShell), you’ll get an error because Command Prompt doesn’t execute PowerShell commands directly. Always open PowerShell first.
- Missing admin rights: PowerShell 5.1 may require admin access for certain checks. Try the admin prompt method in step 4 above if you see a permission error.
-
Typo in commands: A misspelled command like
Get-PowerShellVerreturnsCommandNotFoundException. Double-check the spelling in the guide. -
Running in an older shell: On Windows 7, PowerShell 2.0 is default. Use the admin prompt method or manually load the full version:
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Set-ExecutionPolicy RemoteSigned -Scope CurrentUser"before running the version check.
Tips
-
Compare versions: Use the
Get-PowerShellVersionoutput to check compatibility with scripts or modules. For example, PowerShell 7+ requiresImport-Moduledifferently than 5.1. -
Check multiple profiles: If two instances of PowerShell show different versions, use
Get-ChildItem $PROFILEin PowerShell to find profile settings that might override the default. -
Update PowerShell: If your version is outdated, use the Microsoft store or
winget install Microsoft.PowerShellfor Windows 10/11. For older systems, download from Microsoft’s website. -
Use aliases: PowerShell aliases like
psorverwork for modern versions, but they may not exist in older ones. Test them first. - Test in a sandbox: Run commands in a new PowerShell session (e.g., right-click Start > New > PowerShell) to avoid conflicts from previous scripts.
Troubleshooting
-
Command not recognized: This means PowerShell isn’t installed or isn’t your default shell. Install it via:
- Windows 10/11: Search for "PowerShell" and add it to PATH in Settings > Apps > Optional Features.
- Windows 7: Download the full installer from Microsoft’s website.
- Permission denied: Try running the admin prompt method (step 4) or grant admin rights to the user account first.
-
No output when using
$PSVersionTable.PSVersion: This is normal for PowerShell 7+—useGet-PowerShellVersioninstead. If it still fails, restart the session:- Close PowerShell completely.
- Open a new terminal (step 1) and run the command again.
-
Version shows as "unknown": This can happen if PowerShell is corrupted. Reset it by:
- Run
Get-AppxPackage *PowerShell*and uninstall it. - Reinstall PowerShell from the Microsoft store or official source.
- Run
-
Running on a Linux/macOS system (false positive): If you accidentally launched PowerShell on macOS/Linux, use
uname -ain the terminal to confirm it’s not PowerShell.
Frequently Asked Questions
Why does PowerShell show an older version?
If you see PowerShell 5.1 when updating to Windows 10/11, it’s installed but not your default shell. Use the admin prompt method (step 4) or install PowerShell 7+ from the Microsoft store.
Can I check PowerShell version in a script?
Yes! Add this at the start of your script:
$PSVersionTable.PSVersion | Select Major, Minor, Patch
This returns only the version numbers in a readable format.
What if I get a "Module not loaded" error?
This happens if PowerShell modules are missing. Install them via:
Install-Module -Name
or the Microsoft store.
Does PowerShell version affect compatibility with cmdlets?
Most cmdlets work across versions, but some features (like Import-Module syntax) differ. Check the [Microsoft Docs](https://docs.microsoft.com/en-us/powershell/) for version-specific notes.
How do I force PowerShell to use an older version?
This isn’t supported. If you need legacy features, use PowerShell 5.1 via the admin prompt method or manually copy scripts to a compatible environment.
Why doesn’t powershell.exe in Command Prompt show the version?
Command Prompt launches PowerShell without executing commands—you must type commands inside PowerShell. Use:
powershell.exe -NoProfile -Command "Get-PowerShellVersion"
to force it to check the version.