PowerShell / PowerShell/PSScriptAnalyzer

Should PSScriptAnalyzer suggest use of the RemotingCapability cmdlet attribute when a ComputerName parameter is used?

オープン
#397 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Issue - Discussion Issue - Question
主要言語
C#
スター
2.2k
フォーク
414
平均マージ
13時間 1分
マージ済み PR(30日)
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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

RemotingCapability cmdlet 属性、ComputerName パラメーター、および一覧にある Microsoft.* コア コマンドを確認し、その属性がどのように使用されているか、また実行や作成ガイダンスに影響するかどうかを判断します。推奨事項を文書化し、PSScriptAnalyzer ルールが適切かどうかを判断したうえで、属性の欠落を検出するための明確な範囲を定めれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
powershell
領域
tooling
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。