1. [Wiki](https://feex.it/wiki/)
2. [軟體](https://feex.it/wiki/software/)
3. [System](https://feex.it/wiki/software/system/)
4. Windows PowerShell

# Windows PowerShell

應用程式: Microsoft Corporation

亦稱為 powershell、windows powershell 5.1、pwsh

Microsoft Corporation, System

隨附於 Windows 的 Windows PowerShell 5.1 主機。處理程序為 powershell.exe。PowerShell 7 是 pwsh.exe，為獨立安裝項目。

## 您需要瞭解的資訊

Windows PowerShell 是 powershell.exe。PowerShell 7 是名為 pwsh.exe 的不同安裝項目。

Windows 仍隨附 PowerShell 5.1。Microsoft 將 PowerShell 7 記載為目前的跨平台殼層。兩者可以並存。cmd.exe 是第三種解譯器。

- **它是什麼？**: 內建的 PowerShell 5.1 主機

  **pwsh 與其相同嗎？**: 否。那是 PowerShell 7

  **是否安全？**: 主機是相同的。指令碼則各有不同

Feex 指出

若指令碼指示安裝 PowerShell 7，而您只有 powershell.exe，表示您使用的是 5.1。我不會刪除內建主機來進行「升級」。

## 什麼是 Windows PowerShell？

Windows PowerShell 5.1 是內建的自動化主機。執行檔是位於 WindowsPowerShell\v1.0 下的 powershell.exe。PowerShell 7 則在其旁邊安裝 pwsh.exe。

## 如果您從未用過它

若「開始」顯示「Windows PowerShell」，那就是內建的 5.1 主機。您已經擁有它。接受命令的藍色視窗並非自動代表惡意軟體。PowerShell 7 是名為 pwsh.exe 的獨立下載項目。cmd.exe 是第三種較舊的解譯器。請勿為了「升級」而刪除 5.1。

## 它有什麼用途？

**管理員指令碼**

安裝程式與 IT 指令碼仍會呼叫 powershell.exe，因為 5.1 無處不在。

**單次命令**

Get-Process、檔案作業與快速檢查。主控台主機是 powershell.exe 加上 conhost.exe。

**排定的工作**

登入時隱藏的 PowerShell 通常是一項工作。產品本身不需要「啟動應用程式」。

## 它是為誰設計的？

- 仍擁有僅限 5.1 模組的管理員
- 從「開始」開啟「Windows PowerShell」的使用者
- 在驚慌之前應該先詳讀命令列的人

## 目前狀態

5.1 為內建支援並處於維護狀態。PowerShell 7 則是目前的功能發展版本。本文章涵蓋內建主機，並針對 7 指向 pwsh。

## 它的歷史有多久？

PowerShell 1.0 於 2006 年推出。Windows PowerShell 5.1 是目前 Windows 10 與 11 上的內建主機。PowerShell 7 是最初名為 PowerShell Core 的跨平台版本。Monad 是發行前的名稱。該名稱並非您今天所啟動的項目。

## 版本

主要管道優先。確切的版本號在此並未全部經過驗證。

Windows PowerShell 5.1

PowerShell 7 (pwsh)

## 系統需求

數值遵循發行者的公開指引。實際需求仍會隨工作負載而改變。

### 最低需求

| 作業系統 | 隨受支援的 Windows 10 與 Windows 11 提供 |
| ---- | -------------------------------- |

## 資源概況

- **CPU 需求**: 視指令碼而定

  **RAM 需求**: 大型物件管線

## 已安裝的處理程序

安裝本產品後，這些可執行檔即歸屬於本產品。

| powershell.exe | Windows PowerShell 5.1 |
| -------------- | ---------------------- |
| pwsh.exe       | PowerShell 7 (若已安裝)    |
| conhost.exe    | 主控台視窗                  |

## 啟動元件

登入時隱藏的 PowerShell 是一項工作或捷徑。產品本身不需要「啟動應用程式」。

## 檔案位置

| 5.1 主機 | C:\Windows\System32\WindowsPowerShell\v1.0\\ |
| ------ | -------------------------------------------- |

## 檔案格式

PS1, PSM1

## 常見問題

### EncodedCommand 意外狀況

請閱讀父處理程序。Office 啟動 PowerShell 屬於巨集問題。

### 模組僅適用於 5.1

這就是 Microsoft 保留內建主機的原因。安裝 7 並不會刪除 5.1。

## 疑難排解

### 驚慌之前請先詳讀父處理程序

Office 或瀏覽器啟動已編碼的 PowerShell 屬於指令碼問題。System32 中的主機檔案仍由 Microsoft 提供。

### 若有人要求您使用 pwsh，請從 Microsoft Learn 安裝 PowerShell 7

winget install Microsoft.PowerShell 或存取文件頁面。這會新增 pwsh.exe，並不會取代 5.1。

### 執行原則是一項原則，而非病毒設定

Get-ExecutionPolicy。Restricted 在新 PC 上很常見。這不是損壞的安裝。

## 替代方案

批次檔使用 cmd.exe。目前模組使用 pwsh。請根據您持有的指令碼來挑選，而不是出於流行考量。

## 官方說明與下載

請優先諮詢原廠。隨機出現的 exe 下載網站並非支援管道。

| 概觀 (5.1 與 7)      | [learn.microsoft.com/powershell/scripting/overview ](https://learn.microsoft.com/powershell/scripting/overview)您擁有哪個主機                                                                         |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 安裝 PowerShell 7   | [learn.microsoft.com/powershell/scripting/install/installing-powershell-on-windows ](https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-windows)Windows 上的 pwsh |
| 5.1 參考資料          | [learn.microsoft.com/powershell/scripting/windows-powershell/overview ](https://learn.microsoft.com/powershell/scripting/windows-powershell/overview)內建 Windows PowerShell                     |
| GitHub PowerShell | [github.com/PowerShell/PowerShell ](https://github.com/PowerShell/PowerShell)PowerShell 7 原始碼與版本發行                                                                                             |

## 相關硬體

任何受支援的 Windows PC。遠端工作階段會將工作移至目標。

## 技術詳細資訊

技術詳細資訊

本預覽中並未驗證各版本的檔案雜湊值與大量授權路徑。

## 相關項目

這些實體與本文連結。每個連結上都會顯示類型。

[powershell.exe: 應用程式處理程序](https://feex.it/wiki/l/zh-hant/process/powershell.exe/)[cmd.exe: 應用程式處理程序](https://feex.it/wiki/l/zh-hant/process/cmd.exe/)[Visual Studio Code: 應用程式](https://feex.it/wiki/l/zh-hant/software/visual-studio-code/)

## 來源與驗證

記錄的來源標籤：2026年8月。此標籤不代表獨立驗證。 [我們的研究方式](https://feex.it/wiki/research/).

- [Microsoft Learn：PowerShell ](https://learn.microsoft.com/powershell/scripting/overview)· 5.1 與 7 比較
- [Microsoft Learn：安裝 PowerShell ](https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-windows)· pwsh 安裝
- [Foxhole 處理程序圖譜 ](https://foxhole.feex.it/)· 來自 Windows 電腦的第一手樣本。非實驗室基準測試。

## 這篇文章實用嗎？

只要回答「是」或「否」即可。您也可以依意願選擇原因，或附上簡短說明。

速覽

本頁面的簡短身分識別。規格、來源和完整說明保留在文章中。

- **開發者**: Microsoft Corporation

  **類別**: 命令殼層

  **處理序**: [powershell.exe](https://feex.it/wiki/l/zh-hant/process/powershell.exe/)

  **同級**: pwsh.exe (PowerShell 7)

  **首次發布**: 2006 年 (PowerShell 1.0)。目前 5.1 隨系統內建隨附

  **官方網站**: [learn.microsoft.com/powershell](https://learn.microsoft.com/powershell/scripting/overview)

  **由 Feex 繪製圖譜**: 於 Foxhole 中的 Windows 電腦上發現

記錄的來源狀態：Feex 已審核: 記錄的來源標籤：2026年8月。此標籤不代表獨立驗證。

---

Source: [Canonical Feex Wiki page](https://feex.it/wiki/l/zh-hant/software/windows-powershell/)

[Developer guide](https://feex.it/wiki/developers/) | [API policy](https://feex.it/developers/api-policy/) | [Agent guidance](https://feex.it/wiki/llms.txt)
