Update-PowerShell
Description
Updates PowerShell Desktop to the latest version.
Requirements
- The target OS is not Windows XP, 2003, or Vista/2008, because PowerShell V5 is not available for these operating systems.
- The target OS is not Windows 10 or Server 2016, because PowerShell V5 is installed by default on these systems.
- The target OS is not Windows 7 or Server 2008R2 without SP2, because SP2 must be installed to install PowerShell V5.
- The target OS is not Windows 8, because PowerShell V5 is not applicable to this operating system.
- The target OS is not Windows 7 or Server 2008R2 SP2 if it is missing .NET Framework 4.5.2 or greater, because .NET 4.5.2 is required.
Usage
- Checks for all the requirements and exits if not met.
- Downloads the WMF5 installer based on OS and architecture.
- Extracts the .zip file downloaded, if necessary.
- Executes the MSU installation with
wusa.exe
. - Exits after the installation is complete.
.\Update-PowershellV2.ps1
Updates PowerShell on the target machine to PowerShell V5.