PowerShell / PowerShell/PSScriptAnalyzer

SupportsShouldProcess doesn't care for WhatIfPreference

未關閉
#1,892 5 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

Resolution - By Design
主要語言
C#
星號
2.2k
分支
415
平均合併
13 小時 1 分鐘
30 天內合併 PR
2

描述

Summary of the new feature
It seems the SupportShouldProcess rule doesn't always pick up WhatIf being passed to a function later on. It mostly does this for external modules (that do it properly), but not when the functions are within the same module (different files) that I am actually building.

image

Proposed technical implementation details (optional)
I guess a prescan should be made and if there are commands with explicit WhatIf calls or WhatIfPreference calls it should treat it as condition to ignore.

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先重現 SupportsShouldProcess 的行為,測試在同一模組中的函式之間傳遞 WhatIfPreference,然後檢查 SupportsShouldProcess 規則及其對模組邊界的處理。完成標準是:同一模組中的函式明確使用 WhatIf 或 WhatIfPreference 時能夠一致地被識別,且不會產生誤報。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
csharp, powershell
領域
devtools, tooling
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。