Check Your PowerShell Version ($PSVersionTable)
See which PowerShell version and edition is running before running version-sensitive scripts.
01Command
$ $PSVersionTable.PSVersion02What it does
$PSVersionTable is an automatic variable whose PSVersion field shows the engine version, and the Edition field distinguishes Desktop (Windows PowerShell 5.1) from Core (PowerShell 7+). Some modules only run on one edition, so checking first avoids confusing compatibility errors. To try PowerShell 7 without replacing 5.1, install it side by side with winget install --id Microsoft.PowerShell.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- about_Automatic_VariablesEvidence: Documents $PSVersionTable, the automatic hashtable containing PSVersion, Edition (Desktop/Core) and platform details of the running engine.
- about_PowerShell_EditionsEvidence: Explains the Desktop edition (Windows PowerShell 5.1) versus Core edition (PowerShell 7+) and their module compatibility differences.
Last verified: 2026-09-18 · Category: Developer
06Related solutions
Use Windows Package Manager to install, search, and upgrade thousands of applications from the community repository in one command.
Understand PowerShell's execution policy scopes and set the one that lets you run your own local scripts without gutting the security model.
Search inside text files and logs with regex, returning file, line number and match.