Skip to content

The PowerShell analyzer is pinned in the Makefile, installed with Install-PSResource in CI, and checked by the local gate #1110

Closed

Description

@David-Noble-at-work

Problem

CI installs PSScriptAnalyzer with PowerShellGet v2, Set-PSRepository -Name PSGallery then Install-Module -RequiredVersion 1.25.0, the older of PowerShell's two module installers. On #1108 that step failed (No repository with the name 'PSGallery' was found) and a rerun passed. The version is written into ci.yaml and nowhere else, and a developer's machine gets the analyzer however its profile installs it: on DANOBLE-UD24-1, personal's profile installs the newest version, unpinned, in interactive sessions only (#670's analysis, 2026-10-20). Nothing checks that the analyzer the local gate runs is the one CI pins.

Resolution

  • The Makefile pins the version, as it pins golangci-lint's, and prints it for CI to read: one pin, one place to bump it.
  • CI installs it with PSResourceGet, which ships with PowerShell 7.4 and later with PSGallery registered: Install-PSResource -Name PSScriptAnalyzer -Version <pin> -Repository PSGallery -TrustRepository -Scope CurrentUser.
  • The local gate refuses to run the PowerShell lint with any other version installed, and says how to install the pinned one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions