PowerShell / PowerShell/PSResourceGet
Update-ModuleManifest corrupts PrivateData in module manifest
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 576
- Forks
- 114
- Ø Merge
- 1 T. 2 Std.
- Gemergte PRs (30 T.)
- 7
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit dem Update-ModuleManifest-Befehl und reproduziere den Bericht mit einem Manifest, das RequiredAssemblies und verschachtelte PrivateData.Messages enthält. Vergleiche das Manifest vor und nach der Aktualisierung ausschließlich von ModuleVersion. Fertig ist die Aufgabe, wenn nicht übergebene Attribute intakt bleiben, einschließlich der verschachtelten Messages-Hashtable, mit Regressionstests für beide gemeldeten Fälle.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- powershell
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100