PowerShell / PowerShell/PSResourceGet

Update-ModuleManifest corrupts PrivateData in module manifest

Abierto
#307 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Area-InfoFile Issue-Bug
Lenguaje dominante
C#
Estrellas
576
Forks
114
Merge medio
1 d 2 h
PR fusionados (30 d)
7

Descripción

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-ModuleManifest removes this attribute completely
RequiredAssemblies = if($PSEdition -eq 'Desktop') {@('lib\net45\someAssembly.dll')} else {$null}
  • PrivateData attribute: I have added additional content as hashtable Messages to module's PrivateData as addtional hashtable aside from PSData as shown below, however, Update-ModuleManifest changes the Messages hashtable to Messages = '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.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con el comando Update-ModuleManifest y reproduce el informe con un manifiesto que contenga RequiredAssemblies y PrivateData.Messages anidado. Compara el manifiesto antes y después de actualizar únicamente ModuleVersion. Se considera terminado cuando los atributos no pasados permanecen intactos, incluida la tabla hash Messages anidada, con cobertura de regresión para ambos casos informados.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
powershell
Área
tooling
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
42/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.