Install PowerShell 5.1

Let's see how to easy install PowerShell 5.1 in case you get error like "is not recognized as the name of a cmdlet, function, script file, or operable program"

I was trying to install packages using PowerShell, but i got this error message

Install-PackageProvider is not recognized as the name of a cmdlet, function, script file, or operable program

The reason was that i was using PowerShell version 4 that do not recognise Install-PackageProvider (and lot of other commands). So I besically need to update it to version 5.1

To check your PowerShell version, use the command $PSVersionTable

PS C:\Users\admin> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      4.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.42000
BuildVersion                   6.3.9600.21616
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion      2.2


PS C:\Users\admin>

To upgrade PowerShell, download the packages from this Microsoft Link and select the version you need (for example, if you have windows server 2012 you need to select Win8.1AndW2K12R2-KB3191564-x64.msu)

You can easily install the packages and after that check the PowerShell version

PS C:\Users\admin> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14409.1005
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14409.1005
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1


PS C:\Users\admin>