We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bbfd063 commit a6623f8Copy full SHA for a6623f8
1 file changed
.github/workflows/__call-common-lint.yml
@@ -372,10 +372,12 @@ jobs:
372
run: |
373
# PSScriptAnalyzer is already installed on GitHub runners
374
if ($env:RUNNER_NAME -notlike 'GitHub Actions*') {
375
- Get-PSRepository -Name PSGallery | Format-List
376
- Find-Module -Name PSScriptAnalyzer -Repository PSGallery
377
-
378
- Register-PSRepository -Default -InstallationPolicy Trusted
+ $repo = Get-PSRepository -Name PSGallery -ErrorAction SilentlyContinue
+ if (-not $repo) {
+ Register-PSRepository -Default -InstallationPolicy Trusted
+ } else {
379
+ Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
380
+ }
381
Install-Module -Name PSScriptAnalyzer -Force
382
}
383
0 commit comments