PowerShell / PowerShell/PSScriptAnalyzer
On github actions ubuntu-latest analysis fails with "The term 'Get-Command' is not recognized as a name of a cmdlet"
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- C#
- Estrelas
- 2.2k
- Forks
- 415
- Merge médio
- 13h 1min
- PRs com merge (30d)
- 2
Descrição
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
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece comparando a execução com falha vinculada do workflow Ubuntu-latest usando PSScriptAnalyzer 1.25 com a execução funcional usando 1.24; o relatório informa que a única alteração é a versão fixada. Reproduza a análise em um projeto PowerShell 7 e determine por que 1.25 não consegue resolver Get-Command. Está concluído quando a análise com 1.25 for concluída com sucesso no mesmo workflow sem reverter para 1.24.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- github-actions, powershell, ubuntu
- Domínio
- ci-cd
- Tipo de issue
- Bug
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Pouca atividade
- Clareza
- Precisa de esclarecimento
- Facilidade para iniciantes
- 45/100