PowerShell / PowerShell/PSScriptAnalyzer

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

Offen
#1,657 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Area - CompatibilityRules Area - Documentation Issue - Bug
Vorherrschende Sprache
C#
Sterne
2.2k
Forks
415
Ø Merge
13 Std. 1 Min.
Gemergte PRs (30 T.)
2

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie mit RuleDocumentation/UseCompatibleCommands.md und der dort referenzierten Dokumentation zu PSCompatibilityCollector. Überprüfen Sie die Syntax von TargetProfiles und die Versionsanforderungen für das Ubuntu- und PowerShell-Beispiel. Dokumentieren Sie anschließend die Werte und klären Sie, ob ungültige Profile abgelehnt oder ignoriert werden. Die Aufgabe ist abgeschlossen, wenn die Dokumentation die Fragen aus dem Beispiel beantwortet und das Verhalten bei fehlerhaften Profilen erklärt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
powershell
Bereich
documentation, tooling
Issue-Typ
Dokumentation
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.