PowerShell / PowerShell/PSResourceGet

[0.9.0-rc1] Install-PSResource install latest prerelease even without '-Prerelease'. Repository: GitLab

Open
#1,406 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-PSRepository New-Repo-Request
Dominant language
C#
Stars
576
Forks
114
Avg merge
1d 2h
Merged PRs (30d)
7

Description

Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.
Steps to reproduce

These packages has been published using 'Publish-PSResource' on a GitLab package registry.

  • MyModule version '1.0.0' ( last stable )
  • MyModule version '1.1.0-dev' ( with prerelease property in manifest )
Install-PSResource 'MyModule'

It will install the prerelease version (1.1.0-dev) in the last stable version folder (1.0.0), which cause the module impossible to import (version does not match).

Other test works fine:

Install-PSResource 'MyModule' -Version '1.0.0'

Install version 1.0.0 correctly.

Install-PSResource 'MyModule' -Prerelease

Install version 1.1.0-dev correctly.

Expected behavior
'MyModule' version *1.0.0* is installed in version folder : "..PowerShell\Modules\MyModule\1.0.0\"
Actual behavior
'MyModule' version *1.1.0-dev* is installed in version folder : "..PowerShell\Modules\MyModule\1.0.0\"
Error details
VERBOSE: Skipping the Version folder 1.0.0 under Module C:\..\PowerShell\Modules\MyModule as it does not have a valid module manifest file.
Import-Module: The specified module 'C:\..\PowerShell\Modules\MyModule \' was not loaded because no valid module file was found in any module directory.
Environment data
ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     0.9.0      rc1        Microsoft.PowerShell.PSResourceGet  {Find-PSResource, Get-InstalledPSResource, Get-PSResourceRepository, Get-PSScriptFileInfo…}

Key   : PSVersion
Value : 7.3.4
Name  : PSVersion


Key   : PSEdition
Value : Core
Name  : PSEdition


Key   : GitCommitId
Value : 7.3.4
Name  : GitCommitId


Key   : OS
Value : Microsoft Windows 10.0.19045
Name  : OS


Key   : Platform
Value : Win32NT
Name  : Platform


Key   : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0…}
Name  : PSCompatibleVersions


Key   : PSRemotingProtocolVersion
Value : 2.3
Name  : PSRemotingProtocolVersion


Key   : SerializationVersion
Value : 1.1.0.1
Name  : SerializationVersion


Key   : WSManStackVersion
Value : 3.0
Name  : WSManStackVersion
Visuals

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue through Install-PSResource against the GitLab package registry, comparing the default command with -Version and -Prerelease. Trace the install and version-folder handling from that entry point; done means the default install selects 1.0.0 and places it in the matching 1.0.0 folder, while -Prerelease still selects 1.1.0-dev.

Written by the indexing model from the issue text.

Assessment

Tech stack
gitlab, powershell
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.