Skip to content

Add integration test asserting a single loaded module version after Install-PSResourceWithRetry #75

Description

Context

Install-PSResourceWithRetry now guarantees that the version selected via Version/Prerelease is the only version of the module loaded in the session: it removes already-loaded instances (Get-Module -Name <Name> -All | Remove-Module) and imports the resolved version with -RequiredVersion -Force -Global.

The existing version-constraint tests assert the resolved version, but nothing asserts that side-by-side loaded versions are actually eliminated (the new behavior this change adds).

Request

Add an integration test that:

  • Pre-imports a module version different from the one the helper will select (e.g. Import-Module <Module> -RequiredVersion <old> before invoking).
  • Runs the helper with a pin to a different version.
  • Asserts that Get-Module -Name <Module> -All returns exactly one loaded instance and that its version equals the selected version.

Acceptance criteria

  • The test fails against the pre-change behavior (side-by-side versions left loaded) and passes with the fix.
  • Runs in the existing Action-Test workflow matrix.

Raised from Copilot review feedback on #74.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions