PowerShell / PowerShell/PSScriptAnalyzer

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

Aperta
#1,657 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Area - CompatibilityRules Area - Documentation Issue - Bug
Lingua principale
C#
Stelle
2.2k
Fork
414
Merge medio
13h 1m
PR unite (30g)
2

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia da RuleDocumentation/UseCompatibleCommands.md e dalla documentazione di PSCompatibilityCollector a cui fa riferimento. Verifica la sintassi di TargetProfiles e i requisiti di versione per l'esempio Ubuntu e PowerShell, quindi documenta i valori e chiarisci se i profili non validi vengono rifiutati o ignorati. Il lavoro è completato quando la documentazione risponde alle domande dell'esempio e spiega il comportamento dei profili malformati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
powershell
Ambito
documentation, tooling
Tipo di issue
Documentazione
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.