(dsc): Add `_purge` to `PSResourceList` resource

Abierto
#2,052 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
64/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
csharp, powershell
Área
cli

Línea de trabajo

Start with the PSResourceList schema, the DSC purge.json property schema, and GetPSResourceListActions. Trace how test, set, and what-if consume those actions, then verify that unmatched installed resources are reported or uninstalled according to _purge and the selected scope.

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

Descripción

feature_request Needs-Triage
Summary of the new feature / enhancement

As a user, I want _purge: true on a PSResourceList instance so that any resource installed from that repository and not present in resources is uninstalled during set, and reported as a difference during test.

resources:
- name: Only these modules
  type: Microsoft.PowerShell.PSResourceGet/PSResourceList
  properties:
    repositoryName: PSGallery
    _purge: true
    resources:
    - name: Pester
    - name: PSScriptAnalyzer

With Pester, PSScriptAnalyzer and Az.Accounts installed from PSGallery, test reports _inDesiredState: false and set uninstalls Az.Accounts.

Proposed technical implementation details (optional)
  • Add _purge to the PSResourceList schema, referencing the DSC purge.json property schema.
  • In GetPSResourceListActions, when _purge is set, append an Uninstall action for every installed resource from the repository that has no matching desired entry. test, set and what-if pick this up automatically since they share that function.
  • Respect scope: only purge from the scopes the listed resources use, or from both when none is specified, and document which one was chosen.
Lenguaje dominante
C#
Estrellas
576
Forks
114
Merge medio
1 d 2 h
PR fusionados (30 d)
7

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.

Más de PowerShell/PSResourceGet

Todos los issues de PowerShell/PSResourceGet

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.