PowerShell / PowerShell/PSResourceGet
Install-Module does not respect ModuleVersion or Guid for Required Modules
@anamnavi ci sta già lavorando.
Dal 10/10/2022.
- Lingua principale
- C#
- Stelle
- 576
- Fork
- 114
- Merge medio
- 1g 2h
- PR unite (30g)
- 7
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Valutazione
Questa issue non è ancora stata valutata.