PowerShell / PowerShell/PSResourceGet
Update-ModuleManifest corrupts PrivateData in module manifest
Nessuno ha ancora preso questa issue.
- Lingua principale
- C#
- Stelle
- 576
- Fork
- 114
- Merge medio
- 1g 2h
- PR unite (30g)
- 7
Descrizione
This bug by @jformacek is copied from https://github.com/MicrosoftDocs/PowerShell-Docs/issues/6767
Usage of this command on existing module manifest breaks it's content. I wanted to use this command inside build pipeline to update ModuleVersion attribute, but found at least 2 things that got broken on my manifest module:
- RequiredAssembles attribute: I have something like below in my manifest file, and
Update-ModuleManifestremoves this attribute completely
RequiredAssemblies = if($PSEdition -eq 'Desktop') {@('lib\net45\someAssembly.dll')} else {$null}
- PrivateData attribute: I have added additional content as hashtable
Messagesto module'sPrivateDataas addtional hashtable aside fromPSDataas shown below, however,Update-ModuleManifestchanges theMessageshashtable toMessages = 'System.Collections.Hashtable', which breaks the logic of module
PrivateData = @{
Messages = @{
NotInitialized = 'Call Initialize-Module before running other cmdlets.'
}
PSData = @{
# ... standard content
}
Would be great to update the command so as it does not change the attributes that are not passed from command line, or at least document here what gets changed/reset when command is run, so as users are not surprised after running it.
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.
Direzione di ricerca
Inizia dal comando Update-ModuleManifest e riproduci il report con un manifest contenente RequiredAssemblies e PrivateData.Messages annidato. Confronta il manifest prima e dopo l'aggiornamento della sola ModuleVersion. Il lavoro è completato quando gli attributi non passati rimangono intatti, inclusa la tabella hash Messages annidata, con copertura di regressione per entrambi i casi segnalati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- powershell
- Ambito
- tooling
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100