PowerShell / PowerShell/PSScriptAnalyzer
Should PSScriptAnalyzer suggest use of the RemotingCapability cmdlet attribute when a ComputerName parameter is used?
還沒有人認領這個 Issue。
- 主要語言
- C#
- 星號
- 2.2k
- 分支
- 414
- 平均合併
- 13 小時 1 分鐘
- 30 天內合併 PR
- 2
描述
This is just a point of discussion. I just came across the RemotingCapability cmdlet attribute and it made me wonder whether or not I should be using it in commands I write that do something remotely. The easiest way I can think of to identify such a command is to detect the presence of a ComputerName parameter. For such commands, is using the RemotingCapability attribute a best practice? I have written many commands that do things remotely, and have yet to use this attribute.
Since many core commands use this rule, presumably it offers some value. Here's a one-liner to see which core commands use this rule:
gcm -module Microsoft.* | % {$md = new-object system.management.automation.commandmetadata $_; $md} | ft Name,RemotingCapability
If RemotingCapability is recommended for commands that do remote management, then PSScriptAnalyzer should probably have a rule to guide users in the right direction (detecting when that attribute is missing where it should be used).
To be honest, at this point I have no idea where/how RemotingCapability is used in PowerShell or PowerShell tools. Is it informational? Does it impact command execution? Or do tools provide script authoring tips, etc?
This should be reviewed so that a rule can be identified if it would help people use this attribute where appropriate.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
檢視 RemotingCapability cmdlet 屬性、ComputerName 參數,以及列出的 Microsoft.* 核心命令,以確定該屬性的使用方式,以及它是否會影響執行或撰寫指引。完成的標準是記錄建議,並決定是否適合使用 PSScriptAnalyzer 規則,同時明確偵測缺少屬性的範圍。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- powershell
- 領域
- tooling
- Issue 類型
- 功能
- 難度
- 5/5
- 預估耗時
- 一週以上
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 25/100