How to Check PowerShell Version

This guide explains how to check your PowerShell version on a Windows computer using the $PSVersionTable command.

Running the latest PowerShell version ensures access to new features and cmdlets. Some scripts may rely on commands not available in older versions, causing compatibility issues. We should keep it up-to-date making it part of your regular monthly patching.

1. Checking Your PowerShell Version

To check your PowerShell version, simply run PSVersionTable:

-- Check PowerShell Version
$PSVersionTable
PSVersionTable example

In this example, the system is running PowerShell version 5.1.19041. We should upgrade to pwsh version 7.

2. Upgrading PowerShell

Windows PowerShell 5.1 is the latest built-in version on Windows, but newer versions, such as PowerShell 7 are available. To install the latest version, follow Microsoft’s official guide: Installing PowerShell, which includes installing on Windows, MacOS and Linux.

Before looking at rolling out upgrades across several Windows hosts, we should look at the current Supported PowerShell Versions for Windows compatibility table from Microsoft.

Hope this guide was useful!


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Posts
Categories
Tags

Always On Availability Groups (AAG) (4) AWS (4) AWS Redshift (6) Certificates & Encryption (3) Change Data Capture (CDC) (2) Database Admin (72) Database Backups & Recovery (14) Database Mirroring (2) Error Messages (5) Git Commands (6) Importing & Exporting Data (2) Linked Servers (3) Linux Admin (2) Logging & Monitoring (1) Measuring Databases (10) Microsoft Patching (2) MySQL (4) Postgres (6) PowerShell Scripts (1) SQL Server Agent (5) SQL Server Database Files (1) SQL Server Data Types (2) SQL Server Management Studio (SSMS) (16) SQL Server Network Connectivity (3) SQL Server on Linux (1) SQL Server Patching (2) SQL Server Performance Tuning (6) SQL Server Processes (SPIDs) (7) SQL Server Replication (2) SQL Server Scripts (13) SQL Server Security (3) Windows Admin (21) Windows Authentication (2) Windows Automation (1) Windows Events (2) Windows Firewall (4) Windows Subsystem for Linux (WSL) (18)