PowerShell / PowerShell/PSResourceGet

Install-Module does not respect ModuleVersion or Guid for Required Modules

Offen
#349 6 Kommentare 1 Reaktion 1 zugewiesene Person Auf GitHub ansehen

@anamnavi arbeitet bereits daran.

Seit 10.10.2022.

Area-Install Issue-Enhancement Needs-Triage
Vorherrschende Sprache
C#
Sterne
576
Forks
114
Ø Merge
1 T. 2 Std.
Gemergte PRs (30 T.)
7

Beschreibung

I use an artifactory server with a nuget repository setup with an internally published location and a cache to psgallery. The end result of this means im able to register a single PSRepository and install both external and internally published modules.

However we have an internal module created called PSLogger which classes with the one found in PSGallery.

I have a module that i wrote that depends on our internal version of PSLogger so I have it included in my manifest file as seen below:

    RequiredModules      = @(
        @{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.6'; GUID = '17a2feff-488b-47f9-8729-e2cec094624c' },
        @{ModuleName = 'PSLogger'; ModuleVersion = '1.0.8'; GUID = 'f892af3d-d369-4eb5-a48a-80017115142f }
    )

For the purpose of this ticket, lets say my module is called MarksModule. When I run Install-Module -Name MarksModule -verbose -Repository 'Artifactory' It will install az.Accounts as expected, it will also install PSLogger, however it ignores the version and guid as it goes and installs this version found here (https://www.powershellgallery.com/packages/PSLogger/1.4.3)

I can confirm PSLogger version 1.0.8 is published to my artifactory repo, however when i download the raw nupkg file and extract the nuspec file i can see the version is correct, but the guid gets dropped.

So there are possibly two issues here, one is the publish doesnt seem to embed the guid into the nuspec file, and 2nd the install-module command ignores version (and guid if it checks the psd1 file)

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.19041.610
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.610
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.