PowerShell / PowerShell/PSScriptAnalyzer

Feature Request: Version property in DiagnosticRecord object

未关闭
#726 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Issue - Discussion
主要语言
C#
星标
2.2k
派生
414
平均合并
13 小时 1 分钟
30 天内合并 PR
2

描述

Spec:
[System.Version] $Version
Stores the version of PSScriptAnalyzer that ran in the Invoke-ScriptAnalyzer test.

Scenario:
I need to know which version of PSScriptAnalyzer ran in my Invoke-ScriptAnalyzer test.

Different versions of PSScriptAnalyzer behave differently. They include different rules and the rules change (see PSPlaceOpenBrace 1.10.0 v. 1.11.0).

This is especially important because you cannot remove an assembly from a PS session. I don't know if this script passed because it's perfect or it passed because I accidentally ran an older version that is missing current rules.

Also, there's no log for script analyzer, so I might log the DiagnosticRecord objects. In that case, the version is critical.

贡献指南

打开贡献指南

从这里开始

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

调研方向

此请求涉及 Invoke-ScriptAnalyzer 返回的 DiagnosticRecord 对象;首先定位该对象以及创建它的调用路径。确认正在运行的 PSScriptAnalyzer 版本会在记录的诊断信息中公开,并且生成的属性可供调用方使用。

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

评估

技术栈
csharp, powershell
领域
devtools
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

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