You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
(dsc): Add _purge to PSResourceList resource #2052
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 modulestype: Microsoft.PowerShell.PSResourceGet/PSResourceListproperties:
repositoryName: PSGallery_purge: trueresources:
- name: Pester
- name: PSScriptAnalyzer
With Pester, PSScriptAnalyzer and Az.Accounts installed from PSGallery, test reports _inDesiredState: false and set uninstalls Az.Accounts.
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.
Activity