How can I determine what version of PowerShell is installed on a computer, and indeed if it is installed at all?
Powershell – Determine installed PowerShell version
powershell
Related Question
- Windows – How to run a PowerShell script
- Powershell – How to handle command-line arguments in PowerShell
- PowerShell says “execution of scripts is disabled on this system.”
- Powershell – What’s the best way to determine the location of the current PowerShell script
- Powershell – How to comment out code in PowerShell
- Powershell – Recursive file search using PowerShell
- Powershell – How to concatenate strings and variables in PowerShell
- Powershell – How to replace every occurrence of a String in a file with PowerShell
Best Solution
Use
$PSVersionTable.PSVersion
to determine the engine version. If the variable does not exist, it is safe to assume the engine is version1.0
.Note that
$Host.Version
and(Get-Host).Version
are not reliable - they reflect the version of the host only, not the engine. PowerGUI, PowerShellPLUS, etc. are all hosting applications, and they will set the host's version to reflect their product version — which is entirely correct, but not what you're looking for.