Let’s help you with checking the PowerShell version and how to update it on a Windows Server.

Straightaway, PowerShell is more of a developer or Sysadmin stuff and was never created for the ordinary Windows user because they have the Common Prompt to play with (ouch 🤐).

In short, PowerShell also runs cmdlets in addition to the Command Prompt commands.

However, we aren’t here to differentiate PowerShell from Command Prompt. Instead, we’ll look at one Microsoft-recommended way that can tell you the PowerShell version.

And though there are other methods to do it all over the internet, they won’t work every time in all situations.

Check PowerShell Version

The first thing is to open PowerShell from the Windows search.

Next, type $PSVersionTable, and hit enter.

<img alt="powershell-version" data- data-src="https://kirelos.com/wp-content/uploads/2022/11/echo/powershell-version.png" data- height="573" src="data:image/svg xml,” width=”687″>

This outputs important information, including the current PowerShell version, edition, compatible versions, etc.

Now coming to other commands that ‘don’t’ work accurately. These include get-host, $host, $host-version, etc.

Notably, they give the version of the host PowerShell has been installed into and not the PowerShell engine version we’re after.

However, use get-host if you have PowerShell version 1.0 since $PSVersionTable was introduced from version 2.0. So this $PSVersionTable won’t give results when used on PowerShell 1.0.

Update PowerShell in Windows Server

You can update PowerShell in the Windows server via command line scripts or downloading and install specific PowerShell versions.

The simplest method is to grab the latest file from the Microsoft website or its GitHub repository and proceed with the installation.

A geeky way to do this from the PowerShell itself is by running iex "& { $(irm https://aka.ms/install-powershell.ps1)} -usemsi".

<img alt="updating-powershell" data- data-src="https://kirelos.com/wp-content/uploads/2022/11/echo/updating-powershell-e1667282321154.png" data- height="678" src="data:image/svg xml,” width=”800″>

This will connect to the MS GitHub repository. Next, respond to the following prompts, and the installation will be complete shortly.

<img alt="powershell-updated-1" data- data-src="https://kirelos.com/wp-content/uploads/2022/11/echo/powershell-updated-1-e1667282657290.png" data- height="678" src="data:image/svg xml,” width=”800″>

Notably, this won’t update the old PowerShell in the system. Instead, you’ll have the updated version installed alongside.

Summing up

This completes checking the PowerShell version and how to update it.

Cmdlets make PowerShell a powerful tool for automation. Still, it would help to take note of a few more scripting languages as a developer.