PowerShell / PowerShell/PSScriptAnalyzer
On github actions ubuntu-latest analysis fails with "The term 'Get-Command' is not recognized as a name of a cmdlet"
Personne n'a encore pris cette issue.
- Langage dominant
- C#
- Étoiles
- 2.2k
- Forks
- 414
- Merge moyen
- 13 h 1 min
- PR mergées (30 j)
- 2
Description
I can't exactly pinpoint what causes this. When I run the pwoershell script analyzet 1.25 on Ubuntu-latest github runners against a powershell 7 project, the analyzer fails to complete its analysis and throws:
Invoke-ScriptAnalyzer: /home/runner/work/_temp/e8c5014b-7f61-4956-b6d1-75953a6d07f6.ps1:7
Line |
7 | $results = Invoke-ScriptAnalyzer -Path './' -Recurse -Settings 'PSScr …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The term 'Get-Command' is not recognized as a name of a cmdlet,
| function, script file, or executable program. Check the spelling of the
| name, or if a path was included, verify that the path is correct and try
| again.
Reverting to 1.24 does not exhibit the issue.
Failing workflow run 1.25:
https://github.com/jessehouwing/actions-semver-checker/actions/runs/32254079386/job/96071605798
Working workflow run 1.24:
https://github.com/jessehouwing/actions-semver-checker/actions/runs/32257267058
No changes other than changing the pinned version:
https://github.com/jessehouwing/actions-semver-checker/pull/454
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par comparer l’exécution échouée liée du workflow Ubuntu-latest avec PSScriptAnalyzer 1.25 à l’exécution fonctionnelle avec 1.24 ; le rapport indique que le seul changement est la version épinglée. Reproduisez l’analyse sur un projet PowerShell 7 et déterminez pourquoi 1.25 ne peut pas résoudre Get-Command. Le travail est terminé lorsque l’analyse avec 1.25 s’achève correctement dans le même workflow sans revenir à 1.24.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- github-actions, powershell, ubuntu
- Domaine
- ci-cd
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Calme
- Clarté
- À clarifier
- Accessibilité débutants
- 45/100