1. [Wiki](https://feex.it/wiki/)
2. [處理程序](https://feex.it/wiki/process/)
3. [應用程式處理序](https://feex.it/wiki/process/application/)
4. pwsh.exe

# pwsh.exe

應用程式處理程序: Microsoft Corporation

處理序分類器搜尋詞 pwsh, powershell 7, powershell core

Windows, 應用程式

PowerShell 7。它是跨平台的 pwsh 主機，通常位於 Program Files\PowerShell\7 底下。它不是 Windows PowerShell 5.1 (powershell.exe)。

## 您需要瞭解的資訊

pwsh 是 PowerShell 7，不是 Windows PowerShell 5.1。

pwsh.exe 是 PowerShell 7，由 Microsoft 安裝為並行主機。powershell.exe 仍是位於 System32\WindowsPowerShell 中的 Windows PowerShell 5.1。Windows Terminal 和 OpenConsole 僅負責繪製視窗。結束 pwsh 不會移除 5.1。

- **是否安全？**: 請檢查正在執行的檔案路徑、簽章與發行者。單憑名稱無法確定安全性。

  **與 powershell.exe 相同？**: 不同。那是 Windows PowerShell 5.1

  **我可以結束它嗎？**: 該 PowerShell 7 工作階段隨即停止

Feex 指出

若看到 pwsh，我會將命令列解讀為 PowerShell 7。我不會將 powershell.exe 視為相同的主機，也不會因為僅限 7 版本的模組而責怪 conhost。

## 什麼是 pwsh.exe？

pwsh 是 PowerShell 7，不是 Windows PowerShell 5.1。5.1 主機依然是 powershell.exe。此檔案是您安裝的較新執行階段。它不是 Windows Terminal。

## 它的作用是什麼？

它執行 PowerShell 7 指令碼與模組。某些 5.1 嵌入式管理單元將無法在此載入。它不會繪製索引標籤 UI (WindowsTerminal.exe)，而且它不是 cmd.exe。

## 為什麼它正在執行？

您開啟了 PowerShell 7、設定為 pwsh 的 VS Code 終端機，或某個工作呼叫了此主機。僅安裝 5.1 的電腦不會顯示 Program Files\PowerShell\7 複本。

## 檢查執行中的處理序

在 Windows PowerShell 中，此唯讀查詢會列出此 PC 上符合條件的處理序 ID、建立時間和可執行檔路徑。

`Get-CimInstance -ClassName Win32_Process | Where-Object { $_.Name -eq 'pwsh.exe' } | Select-Object ProcessId, ParentProcessId, CreationDate, Name, ExecutablePath | Format-List`

無結果或無法存取的路徑是無法確定的。受保護的處理序可能會限制存取，處理序 ID 也可能被重複使用。請將個人路徑保留在本地。

使用 [檔案識別指南](https://feex.it/wiki/l/zh-hant/software/system/verify-executable-path-signature/) 來比較簽章和產品中繼資料。僅憑檔案名稱無法確定安全性。

## 它是否安全？

主機是合法的。指令碼才是問題所在

Program Files\PowerShell 底下具有 Microsoft 簽章的 pwsh 即為 PowerShell 7。Temp 中的 pwsh.exe 則不是。安全性仍取決於父項與 -Command 命令列。這依然不是 powershell.exe。

將記錄的位置與實際檔案進行比較。熟悉的資料夾本身無法確定識別。

`C:\Program Files\PowerShell\7\pwsh.exe`

- PowerShell 7 並行安裝
- Windows PowerShell 5.1 位於 System32\WindowsPowerShell\v1.0\powershell.exe
- 視窗可能是 Windows Terminal 或 OpenConsole

## 我可以結束它嗎？

停止該 7 工作階段

結束 pwsh.exe 會強制終止 PowerShell 7。powershell.exe 5.1 可保留。結束 WindowsTerminal.exe 僅會關閉索引標籤 UI，而不會關閉由工作啟動的每個 7 主機。

## 我可以移除它嗎？

解除安裝 PowerShell 7，保留 5.1

若想移除 pwsh，請從「應用程式」解除安裝 PowerShell。請勿刪除 System32\powershell.exe。請勿刪除 System32。

## 它應該隨 Windows 啟動嗎？

排程工作或設定檔可以啟動 pwsh。那不是 5.1 主機，也不是名為 powershell.exe 的 Windows 預設項目。

## 測量資源使用量

| CPU 和記憶體 | 比較相同 PID 和工作負載的幾項觀察結果。此項目沒有獨立測量的通用基準。    |
| -------- | ---------------------------------------- |
| 磁碟和網路    | 將活動歸因於實際的處理序和目前的任務；僅憑檔案名稱無法確定預期的目的地或傳輸量。 |

## 檔案資訊

| 可執行檔名稱  | pwsh.exe                               |
| ------- | -------------------------------------- |
| 記錄的安裝路徑 | C:\Program Files\PowerShell\7\pwsh.exe |
| 發行者     | Microsoft Corporation                  |
| 簽章檢查    | 檢查實際檔案；此項目不證明其憑證識別。                    |

## 常見問題

### 僅支援 5.1 的嵌入式管理單元失敗，使用者卻修復 powershell.exe

此主機為 7。請安裝 7 模組或執行 Windows PowerShell 5.1。不同的 exe，不同的資源庫情況。

### 來自隨機工作的隱藏 pwsh

請閱讀 -File / -Command。該 7 主機依然是 Microsoft 原生程式。負載取決於命令列。這不是「Terminal 是惡意軟體」。

## 疑難排解

在進行任何具破壞性的變更之前，請先進行診斷。

### pwsh -v 與 powershell.exe 中的 $PSVersionTable

7 從此檔案輸出。5.1 從 Windows PowerShell 輸出。請勿混淆升級文件。

### 以針對 5.1 的相同方式檢查父項 PID

explorer 加上捷徑代表是您操作的。Office 啟動 pwsh 則是巨集相關問題。請勿將刪除 7 安裝資料夾作為第一步。

## 技術詳細資訊

技術詳細資訊

| 映像名稱 | pwsh.exe                                |
| ---- | --------------------------------------- |
| 同級   | powershell.exe (Windows PowerShell 5.1) |

## 檢查執行中檔案的身分

僅憑檔案名稱無法確定安全性。請驗證實際路徑、簽章和產品識別。

## 相關項目

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

[powershell.exe: 應用程式處理程序](https://feex.it/wiki/l/zh-hant/process/powershell.exe/)[cmd.exe: 應用程式處理程序](https://feex.it/wiki/l/zh-hant/process/cmd.exe/)[WindowsTerminal.exe: 應用程式處理程序](https://feex.it/wiki/l/zh-hant/process/windowsterminal.exe/)[檢查可執行檔路徑和數位簽章: 指南](https://feex.it/wiki/l/zh-hant/software/system/verify-executable-path-signature/)[閱讀工作管理員並比較處理序活動: 指南](https://feex.it/wiki/l/zh-hant/software/system/how-to-read-task-manager/)[應用程式處理序: 類別](https://feex.it/wiki/process/application/)

## 來源與驗證

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

- [Microsoft Learn: PowerShell 7 vs Windows PowerShell ](https://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell)· pwsh.exe 是 PowerShell 7，powershell.exe 是 5.1
- [Microsoft Learn: install PowerShell on Windows ](https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-windows)· 一般路徑為 Program Files\PowerShell\7
- [Foxhole 處理程序圖譜 ](https://foxhole.feex.it/)· 來自 Windows 電腦的第一手樣本。非實驗室基準測試。
- [Microsoft Sysinternals: Sigcheck ](https://learn.microsoft.com/en-us/sysinternals/downloads/sigcheck)· 說明如何檢查檔案簽章。此參考資料並不代表特定執行中檔案的身分或安全性。
- [Microsoft：Get-CimInstance ](https://learn.microsoft.com/en-us/powershell/module/cimcmdlets/get-ciminstance)· 唯讀的本機處理序查詢方法。
- [Microsoft：Win32_Process 屬性 ](https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-process)· 記錄處理序 ID、可執行檔路徑、建立日期和父處理序 ID 重複使用。

## 這篇文章實用嗎？

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

速覽

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

- **類型**: 應用程式處理程序

  **發行者**: Microsoft Corporation

  **可執行檔**: pwsh.exe

  **典型路徑**: C:\Program Files\PowerShell\7\pwsh.exe

  **記錄內容**: Feex Wiki 參考項目

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

---

Source: [Canonical Feex Wiki page](https://feex.it/wiki/l/zh-hant/process/pwsh.exe/)

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