Share via


安裝 Windows PowerShell

從 Windows 7 SP1 和 Windows Server 2008 R2 SP1 開始,根據預設,每個 Windows 中都已預先安裝 Windows PowerShell。

在 Windows 11、10、8.1、8.0 和 7 中尋找 PowerShell

有時,由於 PowerShell 主控台或整合式指令碼環境 (ISE) 的位置會從某個 Windows 版本移到下一個版本,因此要在 Windows 中找到並不容易。

下表有助於在您的 Windows 版本中找到 PowerShell。 此處列出的所有版本都是發行之後未經更新的原始版本。

主控台

  • 針對 Windows 10 和 11 - 按兩下左下角 (的 [Windows] 圖示,Windows 10、Windows 11) 的較低中心,開始輸入 PowerShell。
  • 針對 Windows 8.1 - 在開始畫面上,開始輸入PowerShell。 如果位於桌面上,請按兩下角的 [Windows] 圖示,開始輸入PowerShell。

ISE

  • 針對 Windows 10 和 11 - 按兩下左下角的 Windows 圖示 (Windows 10、Windows 11) 的較低中心,開始輸入 ISE。
  • 針對 Windows 8.1 - 在開始畫面上,輸入 PowerShell ISE。 如果位於桌面上,請按兩下左下角 Windows 圖示,輸入 PowerShell ISE

在 Windows Server 版本中尋找 PowerShell

從 Windows Server 2008 R2 開始,可以不使用圖形化使用者介面 (GUI) 安裝 Windows 作業系統。 不含 GUI 的 Windows Server 版本會命名為 Core 版本,而含 GUI 的版本會命名為 Desktop

Windows Server Core 版本

在所有 Core 版本中,當您登入伺服器時,會看到 Windows 命令提示字元視窗。

鍵入 powershell 並按 ENTER,以在命令提示字元工作階段內啟動 PowerShell。 輸入 exit 以關閉 PowerShell 工作階段,並返回命令提示字元。

Windows Server Desktop 版本

在所有 Desktop 版本中,按一下左下角 Windows 圖示,開始鍵入 PowerShell。 您會同時取得主控台和 ISE 選項。

上述規則的唯一例外是 Windows Server 2008 R2 SP1 中的 ISE。 在此情況下,按兩下角的 Windows 圖示,輸入 PowerShell ISE。

如何檢查 PowerShell 版本

若要知道您安裝的 PowerShell 是哪個版本,請開啟 PowerShell 主控台 (或 ISE),鍵入 $PSVersionTable 並按 ENTER。 尋找 PSVersion 值。

升級現有的 Windows PowerShell

PowerShell 的安裝套件隨附於 WMF 安裝程式。 WMF 安裝程式的版本符合 PowerShell 的版本。 Windows PowerShell 沒有獨立的安裝程式。

如果您需要在 Windows 中更新現有的 PowerShell 版本,請使用下表找出您想要更新的目標 PowerShell 版本安裝程式。

Windows PS 3.0 PS 4.0 PS 5.0 PS 5.1
Windows 11
Windows Server 2022
- - - 已安裝
Windows 10 (請參閱備註 1)
Windows Server 2016
- - - 已安裝
Windows 8.1
Windows Server 2012 R2
- 已安裝 不支援 WMF 5.1
Windows 8
Windows Server 2012
已安裝 不支援 不支援 WMF 5.1
Windows 7 SP1
Windows Server 2008 R2 SP1
不支援 不支援 不支援 WMF 5.1

注意

在已啟用自動更新的 Windows 10 初始版本上,PowerShell 會從 5.0 版更新為 5.1 版。 若 Windows 10 的原始版本未透過 Windows Updtaes 更新,PowerShell 的版本會是 5.0。

Microsoft Azure PowerShell

如果您要尋找 Azure PowerShell,可以從 Azure PowerShell 概觀著手。

另請參閱