Server 2012 R2 - Download _verified_ Powershell 5.1 For Windows

Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full' | Get-ItemPropertyValue -Name Release

For automatic reboot:

To upgrade to PowerShell 5.1, you must download and install the Windows Management Framework (WMF) 5.1 . PowerShell 5.1 is not available as a standalone installer; it is bundled as part of this broader management framework. Essential Download & Setup Details download powershell 5.1 for windows server 2012 r2

WMF 5.1 requires Microsoft .NET Framework 4.5.2 or higher to be installed before you run the WMF installer. download powershell 5.1 for windows server 2012 r2