给 Windows 7 升级 PowerShell

用前说明

该教程仅限于 x86_64 的系统/CPU

下载必要组件

Microsoft Learn 中选择 Windows 7 SP1 和 Windows Server 2008 R2 SP1 字样的安装程序,并选择一个版本点进去(以 WMF 5.1 为例)
升级现有 Windows PowerShell
在新标签页中点击“Download”
下载
然后选择 Win7AndW2K8R2-KB3191566-x64.zip
正确的包

安装

打开下载好的 Win7AndW2K8R2-KB3191566-x64.zip,把 Win7AndW2K8R2-KB3191566-x64.msu 解压出来并安装
安装 KB3191566
完成后点击“立即重新启动”
重启
重启后 PowerShell 版本就升级了,在 PowerShell 中输入

1
$PSVersionTable

即可到查看 PowerShell 版本是新版本
PowerShell 版本

后记

或者你也可以直接在 GitHub 上下载最新的 PowerShell
PowerShell Preview
能不能用是另一回事(小声