How to check the PowerShell version and update it on Windows Server?
Let's help you check your PowerShell version and how to update it on Windows Server.
To put it bluntly, PowerShell is more suited to developers or system administrators and was never made for general Windows users because they have a generic prompt to play with (oops 🤐).
In short, PowerShell also runs cmdlets in addition to command line commands.
However, we are not here to distinguish PowerShell from the command line. Instead, we'll look at one of Microsoft's recommended ways to determine the PowerShell version.
And while there are other ways to do this all over the web, they won't work every time in all situations.
Check PowerShell Version
First, open PowerShell from Windows Search.
Then type $PSVersionTable and press Enter.
This prints important information including the current PowerShell version, release, compatible versions, etc.
Now let's move on to other commands that "do not work" for sure. These include get-host, $host, $host-version, etc.
Notably, they indicate the version of the host that PowerShell was installed on, not the version of the PowerShell engine we're looking for.
However, use get-host if you have PowerShell version 1.0, since $PSVersionTable was introduced in version 2.0. Therefore, this $PSVersionTable will not produce results when used in PowerShell 1.0.
Update PowerShell on Windows Server
You can update PowerShell on a Windows server using command line scripts, or you can download and install specific versions of PowerShell.
The easiest way is to download the latest file from the Microsoft website or GitHub repository and proceed with the installation.
A fancy way to do this from PowerShell itself is to run iex "& { $(irm https://aka.ms/install-powershell.ps1)} -usemsi".
This will connect to the MS GitHub repository. Then answer the following prompts and the installation will be completed shortly.

Notably, this will not update the old PowerShell on the system. Instead, you will have an updated version installed.
Summarizing
This completes checking the PowerShell version and how to update it.
Cmdlets make PowerShell a powerful automation tool. However, it would be useful for a developer to look at a few more scripting languages.
Did you enjoy reading the article? How about sharing with the world?
What do you think of this article?