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

Đang mở
#2,052 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
64/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp, powershell
Lĩnh vực
cli

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
C#
Star
576
Fork
114
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
7

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PowerShell/PSResourceGet

Tất cả issue của PowerShell/PSResourceGet

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.