PowerShell / PowerShell/PSScriptAnalyzer

Function 'GetCommandInfo' does not add CommandInfo to cache

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

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

Area - Rules Issue - Bug
主要言語
C#
スター
2.2k
フォーク
414
平均マージ
13時間 1分
マージ済み PR(30日)
2

説明

In Helper.cs, the function GetCommandInfo checks the commandInfoCache for a given command, and - if it does not exist in the cache - retrieves the info from a powershell session. Unlike in the deprecated function GetCommandInfoLegacy, however the command info is never added to the commandInfoCache dictionary. (Compare lines 750 and 776)

I'd like to open a PR to correct this, assuming this is indeed a bug.

This should help marginally with performance issues due to contentions from the locks in the GetCommandInfo and GetCommandInfoLegacy functions.

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

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

はじめの一歩

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

調査の方向性

Helper.cs の GetCommandInfo から始め、特に 750 行目と 776 行目付近の参照されている行について、そのキャッシュパスを GetCommandInfoLegacy と比較します。取得されたコマンドの CommandInfo が commandInfoCache に追加されることを確認します。完了条件は、キャッシュが legacy パスと一貫して設定されることです。

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

評価

技術スタック
csharp, powershell
領域
tooling
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
55/100

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

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