(dsc): Add `_purge` to `PSResourceList` resource
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 64/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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
_purgeto thePSResourceListschema, referencing the DSCpurge.jsonproperty schema. - In
GetPSResourceListActions, when_purgeis set, append anUninstallaction for every installed resource from the repository that has no matching desired entry.test,setand 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.
- Dominant language
- C#
- Stars
- 576
- Forks
- 114
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 7
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PowerShell/PSResourceGet
-
Create parent directories only after the containment check in InstallHelper.TryExtractToDirectory Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PowerShell/PSResourceGet#2056 ·
-
feature_request
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
PowerShell/PSResourceGet#2013 · 3 comments ·
-
Needs-Triage
Difficulty 3/5 1-2 days Newbie friendliness 68/100
PowerShell/PSResourceGet#2055 ·
-
Needs-Triage
Difficulty 3/5 1-2 days Newbie friendliness 72/100
PowerShell/PSResourceGet#2054 ·
-
(dsc): Export ignores `--input` filter for `Repository` and `PSResourceList` on DSC 3.3.* or above OpenNeeds-Triage
Difficulty 3/5 1-2 days Newbie friendliness 72/100
PowerShell/PSResourceGet#2053 ·
All issues in PowerShell/PSResourceGet
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100