On github actions ubuntu-latest analysis fails with "The term 'Get-Command' is not recognized as a name of a cmdlet"
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- github-actions, powershell, ubuntu
- Domain
- ci-cd
Research direction
Start by comparing the linked failing Ubuntu-latest workflow run using PSScriptAnalyzer 1.25 with the working 1.24 run; the report says the only change is the pinned version. Reproduce the analysis against a PowerShell 7 project and determine why 1.25 cannot resolve Get-Command. Done means the 1.25 analysis completes successfully on the same workflow without reverting to 1.24.
Written by the indexing model from the issue text.
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
- Dominant language
- C#
- Stars
- 2.2k
- Forks
- 415
- Avg merge
- 13h 1m
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PowerShell/PSScriptAnalyzer
-
Up-for-Grabs
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
PowerShell/PSScriptAnalyzer#2213 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
PowerShell/PSScriptAnalyzer#2217 · 1 comment ·
-
PSUseConsistentIndentation double-indents attribute bodies that open a scriptblock (`[Attr({ … })]`) Open
Difficulty 3/5 1-2 days Newbie friendliness 70/100
PowerShell/PSScriptAnalyzer#2216 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
PowerShell/PSScriptAnalyzer#2211 ·
-
`PSPlaceOpenBrace` and `PSPlaceCloseBrace` leave trailing whitespace when expanding one-line blocks Open
Difficulty 3/5 1-2 days Newbie friendliness 70/100
PowerShell/PSScriptAnalyzer#2210 ·
All issues in PowerShell/PSScriptAnalyzer
Similar issues
-
:watch: Not Triaged dotnet-fsharp/svc
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Client customer-reported needs-team-attention question Service Attention WebPubSub
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Azure/azure-sdk-for-net#63292 · 3 comments · 1 reaction ·
-
Issue-Enhancement Needs-Triage
Difficulty 1/5 Under an hour Newbie friendliness 86/100
PowerShell/PowerShell#28061 · 2 reactions ·
-
dependencies needs-team-triage server-Azure.Mcp
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
aspnet-core/svc aspnetcore-signalr/subsvc doc-enhancement Pri2 SignalR
Difficulty 1/5 Under an hour Newbie friendliness 88/100
dotnet/AspNetCore.Docs#37729 ·