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 *