PowerShell / PowerShell/PSScriptAnalyzer

Should Script Analyzer deal with binary modules?

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

还没有人认领这个 Issue。

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

描述

Here's a thought that just came to mind while discussing pluralized nouns in more Azure cmdlets with another MVP:

If a module author creates a binary module with cmdlets that have pluralized nouns, I think (haven't specifically tested these scenarios myself) they can package that up in a module in one of two lazy ways:

  1. Drop the dll into a folder with the same name as the dll (minus the extension), and voila, it's auto-discoverable via PowerShell if it's in the right path.
  2. Drop the dll into a folder with the same name as the dll, along with a manifest with the same name so that you get versioning, have the manifest load the binary module, but leave the default '*' values for all Export_whatever_ manifest attributes so that all cmdlets are exported.

In both of these scenarios, there is nothing that PSScriptAnalyzer can do to flag issues like pluralized nouns or non-standard verbs, is there? Does PSScriptAnalyzer even check a manifest for pluralized nouns in the exported command names, if they are listed?

I started thinking about this because I was wondering how/why so many pluralized nouns were getting included in released modules from the AzureRM group, and if they use binary cmdlets, this may be one of the reasons why. I'm looking forward to PSScriptAnalyzer evolving into simply PSAnalyzer or perhaps adopting a PSModuleAnalyzer sibling that can check for these types of issues, either by loading modules as part of the inspection or, preferably, by inspecting with reflection or other means the contents of binary modules for issues with command naming and attribute use.

贡献指南

打开贡献指南

从这里开始

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

调研方向

未指定文件、测试或入口点。首先查看 PSScriptAnalyzer 当前如何处理模块和清单,然后确定是否可以检查二进制模块的命令名称;要视为完成,还需要确定检测复数名词和非标准动词的范围。

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

评估

技术栈
csharp, powershell
领域
tooling
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

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