---
title: "Check PowerShell Versions: Best Practices"
description: "Discover the best ways to check PowerShell versions on local and remote computers."
canonical: "https://adamtheautomator.com/powershell-version/"
---

# Check PowerShell Versions: Best Practices

> Discover the best ways to check PowerShell versions on local and remote computers.

Source: https://adamtheautomator.com/powershell-version/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Check PowerShell Versions: Best Practices](https://adamtheautomator.com/wp-content/uploads/2019/07/psversiontable.png)

# Check PowerShell Versions: Best Practices

[![](https://secure.gravatar.com/avatar/d0b9d42e21e5622713f8b693aa5c0f9244d5f7dd200ed29b8398f52dee5de337?s=192&d=mm&r=g)Adam Bertram](https://adamtheautomator.com/author/adam-bertram/)27 July 20194 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[PowerShell](/tag/powershell/)

Table of Contents

*   [Get-Host](#get-host)
*   [Check Powershell Version via Get-Host on Remote Computers](#get-host-on-remote-computers)
*   [Check Powershell Version $host.Version command](#-host-version)
*   [$host.Version on Remote Computers](#-host-version-on-remote-computers)
*   [Registry](#registry)
*   [Using Other Tools](#using-other-tools)
*   [Registry on Remote Computers](#registry-on-remote-computers)
*   [Check Powershell Version via $PSVersionTable.PSVersion command](#-psversiontable-psversion)
*   [$PSVersionTable on Remote Computers](#-psversiontable-on-remote-computers)
*   [Summary](#summary)

In PowerShell, there are a zillion ways to do the same thing (or close to it). In this blog post, you’ll learn every way to check your PowerShell version that you have on local and remote computers. We’ll cover the bad ways and my recommended way.

There are websites that show various ways to check your [Powershell](https://adamtheautomator.com/tag/powershell/) version. But none that compiled a comprehensive list of all of them. I decided to change that.

All these ways should work in both Windows PowerShell and PowerShell Core. These methods should also work in Windows PowerShell versions 1.0 all the way up to PowerShell 7.

The ways you can find out a version of PowerShell you’re running are:

1.  The `(Get-Host).Version` property
2.  The `$host.Version` property
3.  The registry (Windows PowerShell only)
4.  The `[$PSVersionTable](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_powershell_editions?view=powershell-7.2#edition-in-psversiontable).PSVersion` property

Let’s break down all the ways to find the version of PowerShell from the least to the most recommended way.

## Get-Host

PowerShell has a concept known as _hosts_. A _host_ is a program that is _hosting_ the PowerShell engine. It is not the PowerShell engine itself. The PowerShell console or a code editor with an integrated terminal are PowerShell _hosts_.

A _host_ can have a version that is completely independent of PowerShell itself_._ This can be deceiving to many newcomers. Let me show you why.

If you run `(Get-Host).Version`, you’ll see that it returns a version number that looks like it could be the PowerShell engine version. Looks can be deceiving.

Below I’ve ran `Get-Host` on Windows PowerShell 5.1 and you can see it comes back with 5.1.17134.858. This looks like a legitimate version.

```powershell
PS51> (Get-Host).Version
Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      17134  858
```

However, sometimes when you run `Get-Host` in an integrated terminal, the version is not the same. Although usually, the _host_ will represent the same version of the engine, it doesn’t necessarily _always_ do that.

### Check Powershell Version via Get-Host on Remote Computers

Even though `Get-Host` _seems_ to return the same version when run on a local computer, it never will on remote computers.

For example, let’s run `Get-Host` on a remote Windows Server 2016 server via [`Invoke-Command`](https://adamtheautomator.com/invoke-command/ "Invoke-Command") and see what happens.

```powershell
PS51> Invoke-Command -ComputerName 10.0.0.5 -ScriptBlock {Get-Host} -Credential $cred

Major  Minor  Build  Revision PSComputerName
-----  -----  -----  -------- --------------
1      0      0      0        10.0.0.5
```

The last time I checked, it’s not possible to run PowerShell v1 on Windows Server 2016.

Relying on `Get-Host` is just a bad idea all around.

## Check Powershell Version $host.Version command

Referencing `$host.Version` is another way to check [Powershell version](https://adamtheautomator.com/powershell-version/ "Powershell version"). The `$host` variable is an automatic variable that returns the same output as `Get-Host`.

![Referencing $host.Version](/wp-content/uploads/2019/07/image-60.png)

Referencing `$host.Version`

There’s nothing special about this method. It’s simply the same as running `Get-Host`.

### $host.Version on Remote Computers

You will see the same behavior via [PowerShell Remoting](https://adamtheautomator.com/psremoting/ "PowerShell Remoting") with `$host.Version` as you will running `Get-Host`.

```powershell
PS51> Invoke-Command -ComputerName 10.0.0.5 -ScriptBlock {$host.Version} -Credential $cred

Major  Minor  Build  Revision PSComputerName
-----  -----  -----  -------- --------------
1      0      0      0        10.0.0.5
```

Danger, Will Robinson!

## Registry

If you don’t want to open up PowerShell itself, you can also check the registry. The version of PowerShell is tucked away under a value in the registry key path `HKLM:\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine`. This registry key has a value called `PowerShellVersion` that you can reference by using `Get-ItemProperty`.

```powershell
PS51> (Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine -Name 'PowerShellVersion').PowerShellVersion
5.1.17134.1
```

You can see that this version is similar but doesn’t include the revision like the other options do.

```powershell
PS51> [version](Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine -Name 'PowerShellVersion').PowerShellVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      17134  1
```

### Using Other Tools

Using the registry also means you don’t need to use PowerShell at all to find the version. You can run commands from the command prompt or another tool that can read the registry.

```bash
CMD> reg query HKLM\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine /v PowerShellVersion

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine
    PowerShellVersion    REG_SZ    5.1.17134.1
```

### Registry on Remote Computers

The registry is static and the values won’t change locally or remotely. You can be confident that what you see locally will be the same as you see remotely.

```powershell
PS51> $scriptBlock = {
    [version](Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine -Name 'PowerShellVersion').PowerShellVersion
}
PS51> Invoke-Command -ComputerName 10.0.0.5 -ScriptBlock $scriptBlock -Credential $cred

Major  Minor  Build  Revision PSComputerName
-----  -----  -----  -------- --------------
5      1      17763  1        10.0.0.5
```

Showing the same version locally and remotely is good. But I’ve got a better way to show you using the `$PSVersionTable` automatic variable.

## Check Powershell Version via $PSVersionTable.PSVersion command

The last and final method is referencing the `PSVersion` property on the `$PSVersionTable` automatic variable. This method will always represent the PowerShell engine.

```powershell
PS51> $PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      17134  858
```

The `$PSVersionTable` automatic variable is a read-only hash table that returns information specifically about the PowerShell engine version. This automatic variable not only returns the version but also PSEdition. This property can either be _Core_ or _Desktop_ to provide further information on the edition of PowerShell that is running.

![$PSVersionTable output](/wp-content/uploads/2019/07/image-62.png)

$PSVersionTable output

### $PSVersionTable on Remote Computers

`$PSVersionTable` reports the PowerShell engine that hosts the remote session. It does not discover the newest PowerShell executable installed on the remote computer. Without `-ConfigurationName`, `Invoke-Command -ComputerName` uses the default `Microsoft.PowerShell` WSMan endpoint, which normally hosts Windows PowerShell 5.1.

To query PowerShell 7, run `Enable-PSRemoting` from an elevated PowerShell 7 (`pwsh.exe`) session on the remote computer. Then select the PowerShell 7 endpoint explicitly:

```powershell
PS> Invoke-Command -ComputerName Server01 `
>>     -ConfigurationName PowerShell.7 `
>>     -ScriptBlock { $PSVersionTable.PSVersion }
```

Use the full endpoint name, such as `PowerShell.7.6.4`, when you must query that exact version. Microsoft documents that Store-based MSIX installations do not support PowerShell remoting. Use a supported MSI or ZIP installation when the computer must accept inbound WSMan sessions.

> _**Important:** `Enable-PSRemoting` changes WinRM, listener, firewall, and session endpoint settings. Run it only on computers that require inbound remoting. If you connect by IP address, use WinRM HTTPS or a narrowly scoped `TrustedHosts` entry, and supply `-Credential`._

See Microsoft’s [Enable-PSRemoting reference](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/enable-psremoting?view=powershell-7.6) and [session configuration reference](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_session_configurations?view=powershell-7.6).

## Summary

In this blog post, you have learned all of the ways to check the version of PowerShell both locally and remotely. I hope the first few methods gave you an idea of which ways _not_ to check the version!

I recommend always using `$PSVersionTable.PSVersion`. All of the other methods may appear similar to the PowerShell engine version but may not always reflect the engine version.

If I missed any way, please let me know in the comments. I’ll be glad to update the post and give you credit.

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-version%2F&text=Check%20PowerShell%20Versions%3A%20Best%20Practices)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-version%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-version%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2026/06/26995-troubleshoot-dns-issues-powershell-codex.webp)

### [Troubleshoot DNS Issues with PowerShell](/troubleshoot-dns-issues-powershell/)

Troubleshoot DNS issues with PowerShell by testing name resolution, DNS client settings, cache entries, and network connectivity in a repeatable workflow.

![](https://adamtheautomator.com/wp-content/uploads/2025/10/image_2025-10-24_095322075.png)

### [Migrating from PowerShell 6 to 7.5: Breaking Changes/New Features](/migrating-powershell-6-to-7-5/)

Migrate from PowerShell Core 6 to 7.5: breaking changes, features, and testing tips.

![](https://adamtheautomator.com/wp-content/uploads/2025/06/featured-image-6.png)

### [How to Add Timeouts to Pester Tests with PowerShell Runspaces](/pester-test-timeout-runspaces/)

Prevent Pester tests from hanging indefinitely using PowerShell runspaces. Learn to handle variable scoping, module loading, TestDrive access, and stream capture challenges with timeout protection.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
