PowerShell / PowerShell/PSScriptAnalyzer

Every time we analyze a '.ps1' file with custom rules, we need to import module once again.

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

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

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

説明

Hi! We are using PSSA to analyze syntax errors in '.ps1' files with custom rules. It seems that a new PowerShell session is created when we invoke-ScriptAnalyzer with custom rules, then all the modules imported before are lost. So, every time we analyze a '.ps1' file with custom rules, we need to import the needed module once again. However, it is time costly for us to import modules again and again. Since we work in the continuous integration environment, we need to import the modules built by CI but not the modules installed locally. 'Import-module' ahead of the '.psm1' file of custom rules seems indispensable. Can you give some suggestions to solve the problem of import modules too many times when analyzing dozens of '.ps1' files? Thanks a lot!

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

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

はじめの一歩

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

調査の方向性

Invoke-ScriptAnalyzer エントリポイントから開始し、カスタム ルールの .psm1 ファイルと PowerShell セッションがどのように扱われるかを追跡します。CI でビルドしたモジュールを使って複数の .ps1 ファイルの解析を再現し、その後、ローカルにインストールされたモジュールを読み込まずにセッションを再利用できるかどうかを確認します。完了の条件は、カスタム ルールが、ファイルごとにインポートしなくても、意図したインポート済みモジュールを使用できることです。

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

評価

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

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

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