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 归类为当前的跨平台 shell。两者可以同时存在。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 需求**: 取决于脚本

  **内存需求**: 大型对象管道

## 安装的进程

这些可执行文件属于该产品安装后的组件。

| 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 是常见情况。这并不代表安装损坏。

## 替代方案

批处理使用 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 电脑。远程会话会将工作转移至目标机器。

## 技术细节

技术细节

此预览版中未验证各版本的文件哈希值和批量许可路径。

## 相关内容

这些实体与本文相关联。每个链接上均显示类型。

[powershell.exe: 应用程序进程](https://feex.it/wiki/l/zh-hans/process/powershell.exe/)[cmd.exe: 应用程序进程](https://feex.it/wiki/l/zh-hans/process/cmd.exe/)[Visual Studio Code: 应用程序](https://feex.it/wiki/l/zh-hans/software/visual-studio-code/)

## 来源与验证

记录的来源标签：August 2026。此标签并不代表已完成独立验证。 [我们的研究方式](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 PC 上的第一方采集样本。非实验室基准测试。

## 这篇文章有用吗？

回答"是"或"否"即可。如果您愿意，可以选择一个原因，或添加一段简短附言。

速览

本页面的简要身份信息。详细规格、来源和完整内容保留在正文中。

- **开发者**: Microsoft Corporation

  **类别**: 命令 shell

  **进程**: [powershell.exe](https://feex.it/wiki/l/zh-hans/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 PC 上捕获

记录的来源状态：Feex 已审核: 记录的来源标签：August 2026。此标签并不代表已完成独立验证。

---

Source: [Canonical Feex Wiki page](https://feex.it/wiki/l/zh-hans/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)
