Set-ProcessMitigation: -Remove does not remove path-scoped entries created with a full -Name path

未关闭 适合新手
#4,143 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
powershell
领域
documentation

调研方向

打开 docset/winserver2025-ps/ProcessMitigations/Set-ProcessMitigation.md,找到 -Name 参数的说明和 -Remove 的示例(例如 Set-Processmitigation -Name test.exe -Remove -Disable DEP)。添加一条注释,说明当 -Name 为完整路径时,该条目是路径限定的(path-scoped),必须在 HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\<name> 下删除。完成的标志是同一条注释出现在该页面的 2025、2022 和 2019 文档集副本中,并且 Markdown 构建时没有 lint 错误。

由索引模型根据 Issue 内容生成。

描述

Page: docset/winserver2025-ps/ProcessMitigations/Set-ProcessMitigation.md (same text in the 2022 and 2019 docsets); also https://learn.microsoft.com/defender-endpoint/enable-exploit-protection

The page documents -Name as <ProcessPathAndFilename.exe> and shows removal as Set-Processmitigation -Name test.exe -Remove -Disable DEP. When -Name is a full path, the cmdlet creates a path-scoped entry (UseFilter=1 on the IFEO key plus a subkey with FilterFullPath), but none of the documented removal forms delete it:

  • -Remove alone: error "Invalid input parameters".
  • -Remove -Disable <mitigation>: succeeds silently, entry unchanged.

Reproduction (elevated PowerShell 7.6 or Windows PowerShell 5.1, Windows 11 Pro 26300, ProcessMitigations module 1.0.12):

Set-ProcessMitigation -Name C:\test\app.exe -Disable ForceRelocateImages
Get-ProcessMitigation -Name C:\test\app.exe   # ForceRelocateImages: OFF; registry has UseFilter + FilterFullPath subkey
Set-ProcessMitigation -Name C:\test\app.exe -Remove                                 # Invalid input parameters
Set-ProcessMitigation -Name C:\test\app.exe -Remove -Disable ForceRelocateImages    # no error, entry still present
Get-ProcessMitigation -Name C:\test\app.exe   # still OFF

-Reset and -Force off also fail with "Invalid input parameters"; -Remove -Enable ForceRelocateImages and a bare-name -Name app.exe -Remove -Disable ForceRelocateImages succeed without removing the entry. Deleting the subkey under the IFEO key by hand is the only way to undo the exemption.

Either the cmdlet should remove such entries, or the page should state that path-scoped entries must be removed from HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\<name> directly.

Also filed in feedback hub: feedback-hub:?contextid=871&feedbackid=c3ac56ef-2214-40a3-96d2-cbed787ec578&form=1&src=1

主要语言
Dockerfile
星标
510
派生
643
平均合并
2 天 21 小时
30 天内合并 PR
8

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

MicrosoftDocs/windows-powershell-docs 的其他 Issue

查看 MicrosoftDocs/windows-powershell-docs 的全部 Issue

相似的 Issue

更多 Documentation Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。