PowerShell / PowerShell/PSScriptAnalyzer

What would be the correct TargetProfile for Ubuntu 20.04 runnin PSCore 7.1.3?

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

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

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

説明

Reading the UseCompatibleCommands documentation, it says the TargetProfiles should follow the syntax:

<os-name>_<os-arch>_<os-version>_<ps-version>_<ps-arch>_<dotnet-version>_<dotnet-edition>

But it falls short on explaining how to get these values.

So, after a little bit of detective work and figuring out which framework version each PowerShell ships with, I come up with the following string:

ubuntu_x64_20.04_7.1.3_x64_5.0.220.61302_core

The most painful to figure out is the 5.0.220.61302 part which I assume is the dotnet-version PowerShell 7.1.3 ships with. Or does it matter?

Especially figuring out the build number is painful because the documentation on the referenced page don't go to explain if 5.0.2 is good enough or should I use the full version 5.0.220.61302.

It's not at all helpful that if I put 'dos_arm_6.1_9.9.9_x64_9999999999_goosfraba' into TargetProfiles, the Invoke-ScriptAnalyzer just merrily goes forward as if nothing happened.

  1. Is ubuntu_x64_20.04_7.1.3_x64_5.0.220.61302_core good for PSCore 7.1.3 running under Ubuntu 20.04?
  2. Could you update the docs when new version of PowerShell is released? It could prove useful if my case was already in the docs so I could just copy/paste it.
  3. Would it at all be possible if Invoke-ScriptAnalyzer would produce at least a warning message when a profile string like 'dos_arm_6.1_9.9.9_x64_9999999999_goosfraba' is passed to it?

Yes, the documentation says I could use PSCompatibilityCollector but when I go there, there's 0 documentation.

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

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

はじめの一歩

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

調査の方向性

RuleDocumentation/UseCompatibleCommands.md と、そこで参照されている PSCompatibilityCollector のドキュメントから始めます。Ubuntu と PowerShell の例について、TargetProfiles の構文とバージョン要件を確認し、その後、値をドキュメント化して、無効なプロファイルが拒否されるのか無視されるのかを明確にします。ドキュメントが例の質問に回答し、不正な形式のプロファイルに対する動作を説明できれば完了です。

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

評価

技術スタック
powershell
領域
documentation, tooling
issue の種類
ドキュメント
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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