PowerShell script to silently install the latest version of PowerShell.


Dev Insight: This script was written to make utilizing other PowerShell scripts that rely on newer versions of PowerShell easier.
This script will install the latest version of PowerShell and allow Windows Update to keep it updated. By default, the script will install the PowerShell version matching the system architecture, but the -x86 switch parameter can be used to install 32-bit PowerShell on 64-bit systems.
Prerequisites: This script requires no additional setup. Simply deploy it via your RMM.


Example Usage: .\InstallPowerShell.ps1 -x86

Learn More

Want to learn more about how this script works? Included below are official documentation links for all cmdlets used in this script, as well as other useful documentation where applicable.
Cmdlet Documentation: