Skip to content

armgit / ODS

Public Imported from GitHub
0

ODS V3 Pre-Release: Public testing and refinement ahead of the official V3 launch. Turn your PC, Mac, or Linux box into a private AI server.

fix(ci): clear handled NuGet exit after analyzer verification (#8231)

Mike Bradleya2c1efbd42e5
diff --git a/.github/workflows/lint-powershell.yml b/.github/workflows/lint-powershell.yml
index f9e272957..ae7491bb9 100644
--- a/.github/workflows/lint-powershell.yml
+++ b/.github/workflows/lint-powershell.yml
@@ -41,7 +41,12 @@ jobs:
Install-Module -Name PSScriptAnalyzer -Repository PSGallery -Scope CurrentUser -Force -AllowClobber
Import-Module PSScriptAnalyzer -ErrorAction Stop
+ Get-Command Invoke-ScriptAnalyzer -Module PSScriptAnalyzer -ErrorAction Stop | Out-Null
Get-Module PSScriptAnalyzer | Format-Table Name, Version, Path -AutoSize
+ # NuGet may leave a nonzero native exit code after a recovered setup
+ # error. Clear it only after the module and analyzer command load;
+ # installation/import failures still terminate before this point.
+ $global:LASTEXITCODE = 0
- name: Run PowerShell Script Analyzer
shell: pwsh