How to Check PowerShell Version in Windows 11, 10 & Linux (2025 Guide)

How to Check PowerShell Version in Windows 11, 10 & Linux (2025 Guide)

Knowing your PowerShell version is crucial in 2025, especially with multiple PowerShell versions available across different platforms. Whether you're running Windows PowerShell 5.1, PowerShell 7.4, or something in between, this guide will show you exactly how to check your version and understand what it means.

Why Checking PowerShell Version Matters in 2025

Compatibility and Features

  • PowerShell 7.4 has features that don't exist in 5.1
  • Cloud modules require specific PowerShell versions
  • Script compatibility depends on PowerShell version
  • Security updates vary by version

Multiple PowerShell Versions In 2025, you might have several PowerShell versions installed:

  • Windows PowerShell 5.1 - Built into Windows 10/11
  • PowerShell 7.4 - Latest cross-platform version
  • PowerShell Core 6.x - Legacy cross-platform (discontinued)

Quick Version Check: The Fast Way

Method 1: Using $PSVersionTable (Recommended)

This works in all PowerShell versions and gives comprehensive information:

$PSVersionTable

Sample Output for PowerShell 7.4:

Name                           Value
----                           -----
PSVersion                      7.4.1
PSEdition                      Core
GitCommitId                    7.4.1
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion          1.1.0.1
WSManStackVersion             3.0

Method 2: Quick Version Number Only

For just the version number:

$PSVersionTable.PSVersion

Output:

Major  Minor  Build  Revision
-----  -----  -----  --------
7      4      1      -1

Method 3: Get-Host Method

Alternative method that also works across versions:

Get-Host | Select-Object Version

Understanding PowerShell Versions in 2025

PowerShell Edition Types

PowerShell Desktop (Windows PowerShell)

  • Edition: Desktop
  • Latest Version: 5.1.22621.2506 (as of 2025)
  • Platform: Windows only
  • Based on: .NET Framework 4.7.2+
  • Status: Maintenance mode (security updates only)

PowerShell Core

  • Edition: Core
  • Latest Version: 7.4.1 (as of January 2025)
  • Platform: Cross-platform (Windows, Linux, macOS)
  • Based on: .NET 8.0
  • Status: Active development

Key Differences in 2025

Feature Windows PowerShell 5.1 PowerShell 7.4
Cross-Platform ❌ Windows only ✅ Windows, Linux, macOS
.NET Version .NET Framework 4.7.2 .NET 8.0
Performance Baseline 40% faster startup
Cloud Integration Limited Full Azure, AWS, GCP
Parallel Processing ForEach-Object ForEach-Object -Parallel
Container Support ❌ None ✅ Full Docker support
Active Development ❌ Maintenance only ✅ Regular updates

Checking PowerShell Version by Platform

Windows 11 & Windows 10

Check Windows PowerShell 5.1:

  1. Press Win + R
  2. Type powershell and press Enter
  3. Run: $PSVersionTable.PSVersion

Check PowerShell 7.4:

  1. Press Win + R
  2. Type pwsh and press Enter
  3. Run: $PSVersionTable.PSVersion

From Command Prompt:

# Check Windows PowerShell
powershell -Command "$PSVersionTable.PSVersion"

# Check PowerShell 7.4
pwsh -Command "$PSVersionTable.PSVersion"

Linux Systems

Ubuntu/Debian:

# Check if PowerShell is installed
pwsh --version

# Detailed version info
pwsh -Command '$PSVersionTable'

CentOS/RHEL/Fedora:

# Check PowerShell version
pwsh --version

# Start PowerShell and check version
pwsh
$PSVersionTable

macOS

Terminal Method:

# Quick version check
pwsh --version

# Detailed version information
pwsh -Command '$PSVersionTable'

Version-Specific Commands and Features

PowerShell 7.4 New Features (2024-2025)

Enhanced Tab Completion:

# Improved IntelliSense and tab completion
Get-Process | Where-Object <TAB>

Parallel Processing:

# Process items in parallel (7.4 improvement)
1..100 | ForEach-Object -Parallel {
    Start-Sleep 1
    "Item $_"
} -ThrottleLimit 10

Better JSON Handling:

# Enhanced JSON depth and formatting
$data | ConvertTo-Json -Depth 10 -Compress

PowerShell 5.1 Specific Features

Windows-Only Cmdlets:

# Only available in Windows PowerShell 5.1
Get-WmiObject -Class Win32_OperatingSystem
Get-EventLog -LogName System -Newest 10

Checking Installed PowerShell Versions

Windows: Find All Installed Versions

Registry Method:

# Check installed PowerShell versions via registry
Get-ChildItem "HKLM:\SOFTWARE\Microsoft\PowerShell\*" | 
    Select-Object PSChildName

File System Method:

# Check PowerShell installation directories
Get-ChildItem "$env:ProgramFiles\PowerShell\" -Directory

Winget Method (Windows 11):

# List installed PowerShell packages
winget list Microsoft.PowerShell

Linux: Package Manager Method

Ubuntu/Debian:

# Check installed PowerShell packages
dpkg -l | grep powershell

CentOS/RHEL:

# Check installed PowerShell packages
rpm -qa | grep powershell

Cross-Platform: Docker Method

# Check PowerShell version in Docker
docker run --rm mcr.microsoft.com/powershell:latest pwsh -Command '$PSVersionTable'

Upgrading PowerShell in 2025

Windows Upgrade Options

Option 1: Download from GitHub

  1. Visit https://github.com/PowerShell/PowerShell/releases
  2. Download the latest MSI installer
  3. Run installer (installs alongside Windows PowerShell)

Option 2: Winget (Recommended for Windows 11)

# Install latest PowerShell
winget install Microsoft.PowerShell

# Upgrade existing installation
winget upgrade Microsoft.PowerShell

Option 3: PowerShell Gallery

# Install PowerShell 7 from within PowerShell 5.1
Invoke-Expression "& { $(Invoke-RestMethod https://aka.ms/install-powershell.ps1) }"

Linux Installation/Upgrade

Ubuntu/Debian:

# Update package list
sudo apt update

# Install PowerShell
sudo apt install -y powershell

Using Snap:

# Install PowerShell via Snap
sudo snap install powershell --classic

macOS Installation/Upgrade

Homebrew:

# Install PowerShell
brew install powershell

# Upgrade PowerShell
brew upgrade powershell

Troubleshooting Version Issues

Common Problems and Solutions

Problem: "pwsh" command not found

# Solution: Add PowerShell to PATH or use full path
/usr/bin/pwsh --version

Problem: Multiple PowerShell versions conflict

# Solution: Use specific version paths
& "C:\Program Files\PowerShell\7\pwsh.exe" -Command '$PSVersionTable'

Problem: Scripts fail with version errors

# Solution: Add version requirements to scripts
#Requires -Version 7.0

Version Compatibility Script

# Check if running minimum required version
if ($PSVersionTable.PSVersion.Major -lt 7) {
    Write-Warning "This script requires PowerShell 7.0 or later"
    Write-Host "Current version: $($PSVersionTable.PSVersion)"
    Write-Host "Download latest: https://github.com/PowerShell/PowerShell/releases"
    exit 1
}

PowerShell Version Best Practices 2025

1. Use PowerShell 7.4 for New Projects

  • Better performance and features
  • Cross-platform compatibility
  • Active development and support
  • Enhanced security

2. Maintain Windows PowerShell 5.1 Knowledge

  • Still required for some Windows-specific tasks
  • Legacy script maintenance
  • Some modules only work with 5.1

3. Version-Specific Script Headers

#Requires -Version 7.0
#Requires -PSEdition Core
# Script description and requirements

4. Environment-Specific Aliases

# Create aliases for different PowerShell versions
Set-Alias -Name ps51 -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
Set-Alias -Name ps7 -Value "C:\Program Files\PowerShell\7\pwsh.exe"

Security Considerations by Version

PowerShell 7.4 Security Features

  • Enhanced execution policies
  • Better credential management
  • Improved logging and auditing
  • Container security improvements

PowerShell 5.1 Security Limitations

  • Older .NET Framework security model
  • Limited cloud authentication options
  • Fewer security updates

Automation Scripts for Version Management

Automated Version Reporting

# Create comprehensive PowerShell version report
$Report = @{
    ComputerName = $env:COMPUTERNAME
    WindowsPowerShell = if (Get-Command powershell -ErrorAction SilentlyContinue) {
        & powershell -Command '$PSVersionTable.PSVersion.ToString()'
    } else { "Not Available" }
    PowerShellCore = if (Get-Command pwsh -ErrorAction SilentlyContinue) {
        & pwsh -Command '$PSVersionTable.PSVersion.ToString()'
    } else { "Not Available" }
    CurrentSession = $PSVersionTable.PSVersion.ToString()
    Edition = $PSVersionTable.PSEdition
    OS = $PSVersionTable.OS
}

$Report | ConvertTo-Json | Out-File "PowerShell-Version-Report.json"

Enterprise Version Audit Script

# Audit PowerShell versions across multiple machines
$Computers = Get-Content "computers.txt"
$Results = foreach ($Computer in $Computers) {
    try {
        Invoke-Command -ComputerName $Computer -ScriptBlock {
            [PSCustomObject]@{
                ComputerName = $env:COMPUTERNAME
                PowerShellVersion = $PSVersionTable.PSVersion.ToString()
                Edition = $PSVersionTable.PSEdition
                OS = $PSVersionTable.OS
            }
        }
    }
    catch {
        [PSCustomObject]@{
            ComputerName = $Computer
            PowerShellVersion = "Connection Failed"
            Edition = "Unknown"
            OS = "Unknown"
        }
    }
}

$Results | Export-Csv "PowerShell-Audit-$(Get-Date -Format 'yyyy-MM-dd').csv" -NoTypeInformation

Conclusion

Checking your PowerShell version in 2025 is essential for:

  • Compatibility: Ensuring scripts work correctly
  • Security: Using the most secure version available
  • Performance: Leveraging latest optimizations
  • Features: Access to newest capabilities

Key Takeaways:

  • Use $PSVersionTable for comprehensive version information
  • PowerShell 7.4 is recommended for new projects
  • Multiple PowerShell versions can coexist
  • Always specify version requirements in scripts

Whether you're a system administrator, DevOps engineer, or PowerShell enthusiast, understanding and managing PowerShell versions is crucial for success in 2025's automation-driven IT landscape.

Frequently Asked Questions

Q: Should I uninstall Windows PowerShell 5.1? A: No! Keep it installed as some Windows features and legacy scripts still require it. PowerShell 7.4 installs alongside it.

Q: How often should I update PowerShell? A: Check for updates monthly. PowerShell 7.4 receives regular updates with security fixes and feature improvements.

Q: Can I run PowerShell 7.4 and 5.1 simultaneously? A: Yes! They're separate installations. Use powershell for 5.1 and pwsh for 7.4.

Q: Which version should I learn as a beginner? A: Start with PowerShell 7.4. It's the future of PowerShell with better features and cross-platform support.

Q: Are there breaking changes between versions? A: Some cmdlets and features differ between 5.1 and 7.4. Always test scripts across versions you need to support.

Ready to upgrade your PowerShell skills? Download PowerShell 7.4 today and experience the latest features and improvements!