Applies To
Windows 11 SE, version 24H2 Windows 11 Enterprise and Education, version 24H2 Windows 11 Enterprise Multi-Session, version 24H2 Windows 11 Home and Pro, version 24H2 Windows 11 IoT Enterprise, version 24H2 Windows Server 2025

原始發布日期: 2025 年 8 月 11 日

KB 編號:5065506

摘要

Windows PowerShell 2.0 是 Windows 7 首次引入的舊元件,將在即將發布的版本中從 Windows 作業系統 (作業系統) 中刪除。 PowerShell 2.0 已於 2017 年正式淘汰,而且它仍可作為相容性的選擇性功能使用,如 Windows PowerShell 2.0 淘汰部落格中所述。 

PowerShell 2.0 將於 2025 年 8 月開始,針對 Windows 11 版本 24H2 和 Windows Server 2025 的 2025 年 9 月版本,在更新版本中移除。 Windows 11 和 Windows Server 2025 的所有更新版本都不會包含 PowerShell 2.0。 Windows Insider Preview 版本 已經反映了這一變化,PowerShell 2.0 功能已於 2025 年 7 月刪除。 此刪除是清理舊版程式碼、降低 PowerShell 生態系統複雜性以及提高 Windows 安全性的更廣泛努力的一部分。 

對於大多數用戶和組織來說,此更改將不會發生任何變化—— PowerShell 5.1 和 PowerShell 7.x 等較新版本的 PowerShell 將繼續可用和支持。 但是,如果您有明確依賴 PowerShell 2.0 的舊腳本或軟體,您將需要採取動作並更新它們或使用因應措施來防止任何中斷。

本文提供了變更的時間表、對不同使用者群組的影響,以及如何緩解任何問題的指導。   

風險降低指引

如果您的環境中確實相依於 PowerShell 2.0,您可以透過以下方式緩解問題: 

  • 建議:將腳本和工具移轉至較新的 PowerShell 版本 Microsoft 的主要指引是使用 PowerShell 2.0 更新任何專案,以使用 PowerShell 5.1 或 PowerShell 7。 PowerShell 5.1 引進了許多改進,並且幾乎所有命令和模組都向後相容。 PowerShell 小組部落格提供此移轉的指南。

  • 更新或更換過時的軟體 在某些情況下,「修復」可能是升級需要 PowerShell 2.0 的軟體。 例如,如果舊安裝程式失敗,請尋找該產品的較新版本。

    • 許多曾經使用 PowerShell 2.0 (Exchange、SharePoint、SQL 等的Microsoft伺服器產品) 具有使用新式 PowerShell 的較新版本。 如果您打算在新版本的 Windows 上執行這些更新版本,請使用這些更新版本。

    • 如果是協力廠商工具,請檢查廠商的網站,以取得移除 PowerShell 2.0 需求的更新或更新版本。 鑑於棄用已經為人所知多年,一些供應商可能已經解決了這個問題。

  • 暫時緩解 注意 這是解除封鎖使用者的暫時性風險降低。 您應該盡快從 PowerShell 2.0 移轉,並使用上面列出的其他風險降低措施。作為最後的暫時緩解措施,您可以使用下列步驟重新安裝 PowerShell 2.0:

    1. 下載 ps2DLC.zip 檔案。

    2. 將 ps2DLC.zip 檔案解壓縮到您選擇的資料夾中。 

    3. 在系統管理模式中啟動 PowerShell 視窗。

    4. 變更至包含解壓縮的 PowerShell 2.0 檔案的資料夾。

    5. 執行下列命令:

      run .\loadGAC.ps1

常見問題集

這是 Microsoft 不再支援的舊版 PowerShell。 

PowerShell 2.0 已於 2017 年正式棄用,現在正在刪除,以鼓勵使用更新、更安全的 PowerShell 版本。 

PowerShell 2.0 將從 Windows 11 版本 24H2 和 Windows Server 2025 開始移除。 

PowerShell 2.0 將於 2025 年 8 月開始,針對 Windows 11 版本 24H2 和 Windows Server 2025 的 2025 年 9 月版本,在更新版本中移除。 Windows 11 和 Windows Server 2025 的所有更新版本都不會包含 PowerShell 2.0。 Windows Insider 預覽版版本 已經反映了此更改,PowerShell 2.0 功能已於 2025 年 7 月刪除,並且不會包含在即將推出的 Insider 版本中。

更新腳本或工具以在較新的 PowerShell 版本上執行,例如 PowerShell 5.1 或 PowerShell 7。 

例如,如果腳本或排程工作明確嘗試啟動 PowerShell 2.0 (,例如使用 powershell.exe -Version 2) 之類的命令,Windows 將無法再執行該舊版引擎。 相反,系統將啟動默認的 PowerShell 版本 (即 PowerShell 5.1) 。 大多數情況下,腳本將繼續工作,因為 PowerShell 5.1 向後兼容。 不過,如果某些較舊的 Script 相依於 2.0 版特有的特定行為,則它們可能無法如預期般執行。 建議的解決方案是更新這些指令碼以移除 -Version 2 需求。 

是的,但這些情況很少見。 例如,如果腳本或排程工作明確使用 PowerShell 2.0 (,則使用 -version 2) ,Windows 將無法再執行該引擎。 這類腳本預設會使用 PowerShell 5.1,在大部分情況下都是相容的。 如果一些腳本依賴 2.0 特有的怪癖,它們可能會有不同的行為。 修復方法是更新這些腳本,使其不需要 -Version 2。 如果您需要額外的協助,請連絡 Microsoft 支援服務。 

一些較舊的非 Windows 軟體可能會嘗試安裝或啟用 PowerShell 2.0 作為安裝的一部分。 在缺少 PowerShell 2.0 的新版本 Windows 上,安裝程式可能會失敗或顯示錯誤。 通常,該軟體已過時且在最新的 Windows 上不受支援。 解決方案是使用不相依於 PowerShell 2.0 的更新軟體版本。  

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。