Skip to content

Feature: PowerShell — pwsh, and the modules a machine needs, each at the version its manifest pins #95

Description

@David-Noble-at-work

Epic: Lore Package Development (#74) · Plan of record: lore-package-development.md

The package

packages/powershell (aliases: pwsh) installs PowerShell 7, then, as a step after the install, the PowerShell modules a machine needs, each at the version its manifest pins. The use case, the owner's of 2026-10-20: a lore package for PowerShell "and include a post install step for installing specific modules". The manifest is where every version is pinned, as the owner designed packages-manifest.yaml: "a one-stop spot for pinning packages. it is the same idea as go.mod."

Why this package exists

Found 2026-10-20, in NobleFactor/devlore-cli#670's analysis (lane 34 of NobleFactor/devlore-cli#949): a developer's machine and CI each get PowerShell and its modules their own way, and nothing holds the two together.

  • A developer's machine. personal's profile installs PSScriptAnalyzer on demand, the newest version at that moment, in interactive sessions only (Install-Module PSScriptAnalyzer -Scope CurrentUser, David-Noble-at-work/personal#207). pwsh itself was a tarball unpacked by hand.
  • CI. Each repository's workflow runs Install-Module PSScriptAnalyzer -RequiredVersion 1.25.0 on every run, from a fresh home, against the runner image's own pwsh.
  • They agree today on 1.25.0 by coincidence. A newer release, on a machine set up later, lints locally with a different analyzer than CI's.

One package, pinned in one manifest, installs the same PowerShell and the same modules wherever it runs: a developer's machine, a new one, and CI.

The module step

  • Install-PSResource, not Install-Module. PSResourceGet, the successor to PowerShellGet, ships with PowerShell 7.4 and later, with PSGallery registered: Install-PSResource -Name <module> -Version <pinned> -Repository PSGallery -TrustRepository -Scope CurrentUser. Install-Module is PowerShellGet v2, the older route; it is what failed in fix(install): install.ps1 knows whether a new terminal would run what it installed, and says only what is so devlore-cli#1108's CI, Set-PSRepository: No repository with the name 'PSGallery' was found (the runner's, it appears, since a rerun passed).
  • winget does not install modules. It installs applications, PowerShell itself among them (Microsoft.PowerShell), but has no PSGallery source: on danoble-wd11-3, winget search PSScriptAnalyzer and winget search posh-git find nothing.
  • Idempotent. A module already installed at the pinned version is left alone; at another version, the pinned one is installed beside it, and which one loads is stated.
  • The first modules: PSScriptAnalyzer at the version CI pins, 1.25.0 today; posh-git, which the same profile installs on demand.

Platform install story

To research and verify at build, each claim with its source, as the authoring process requires:

Open questions, the owner's

  1. Where the module pins live: in the package's manifest, or in the packages-manifest.yaml that names the package, as a layer's own pins (one PowerShell package, each layer its own modules).
  2. Scope: CurrentUser, as the profile and CI install today, or AllUsers.
  3. Whether a profile's on-demand installs go once this package installs the same modules at pinned versions.
  4. Whether CI deploys this package to get its analyzer, so that CI and a developer's machine run one definition (CI must be a strict superset of the local checks devlore-cli#670, item 2).

Activity

  1. David-Noble-at-work commented on Nov 9, 2026

    @David-Noble-at-work
    ContributorAuthor

    star github triage sweep added this issue to Triage: devlore, for the rule it breaks:

    • no-evidence: no Evidence of completion section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions