2017年9月21日 星期四

[研究] PowerShell 5.1、Windows Management Framework (WMF) 5.1 安裝 (Windows 7)

[研究] PowerShell 5.1 安裝 (Windows 7)
[研究] Windows Management Framework 5.1 (WMF) 安裝 (Windows 7)

2017-09-21

環境:Windows 7 with SP1

(下圖) Windows 7 with SP1 的 PowerShell 版本為 2.0
如果要使用新版 PowerShell,必須下載安裝 Windows Management Framework (WMF) 5.1,裡面有新版 PowerShell

Windows Management Framework 5.1 下載
https://www.microsoft.com/en-us/download/details.aspx?id=54616
要安裝 WMF 5.1,至少要 .NET Framework 4.5.2版

對於 Windows 7 環境而言,請下載 Win7AndW2K8R2-KB3191566-x64.zip
解壓後有 Install-WMF5.1.ps1 和 Win7AndW2K8R2-KB3191566-x64.msu

Install and Configure WMF 5.1
https://docs.microsoft.com/en-us/powershell/wmf/5.1/install-configure

(下圖) 啟動 PowerShell,切換到 WMF 5.1目錄,執行  .\Install-WMF5.1.ps1,失敗,因為這個系統上已停用指令碼執行

(下圖) 「以系統管理員身分執行」 Windows PowerShell

(下圖) 執行 Set-ExecutionPolicy  RemoteSigned,啟用 指令碼執行

(下圖) 雖然可執行了,但是需要 .NET 4.5.2

(下圖) 安裝 .NET Framework 4.7 版,失敗,點 update 超連結,下載需要的 update 程式 (KB4019990)

(下圖) 安裝 KB4019990

(下圖) 再次安裝 .NET Framework 4.7,成功。

(下圖) 再次安裝 WMF 5.1



(下圖) Windows 7 上 PowerShell 環境執行 get-host,版本升級到 5.1 了


(完)

沒有留言:

張貼留言