Upgrade To Powershell Version 5
I needed to upgrade one of our Windows 2012 R2 servers from Powershell 4 to Powershell 5. So that I could take advantage of the Install-Module command from the Microsoft gallery.
To find out what version of Powershell you are currently running. Run the following
$psversiontable.psversion
If you find you want to upgrade after checking the version number. Use the links below to download the right package for your OS. On the KB article, there was no mention of a different version for 2012 and 2012 R2. But note below there are adifferent versions for 2012 and 2012 R2
Operating System | Architecture | Package Name |
---|---|---|
Windows Server 2012 R2 | x64 | Win8.1AndW2K12R2-KB3134758-x64.msu |
Windows Server 2012 | x64 | W2K12-KB3134759-x64.msu |
Windows Server 2008 R2 | x64 | Win7AndW2K8R2-KB3134760-x64.msu |
Windows 8.1 | x64 | Win8.1AndW2K12R2-KB3134758-x64.msu |
Windows 8.1 | x86 | Win8.1-KB3134758-x86.msu |
Windows 7 SP1 | x64 | Win7AndW2K8R2-KB3134760-x64.msu |
Windows 7 SP1 | x86 | Win7-KB3134760-x86.msu |
A full list if the versions can be found here https://msdn.microsoft.com/en-us/powershell/wmf/install
The version of powershell can be find out with
$psversiontable.psversion
$Host.version results in the version of the console, not the Powershell version