Skip to content

(dsc): Implement PSResource and RepositoryList DSC resources #2051

Description

@Gijsreyn

Summary of the new feature / enhancement

As a user, I want a Microsoft.PowerShell.PSResourceGet/PSResource resource so that a single module or script can be declared without wrapping it in a PSResourceList, and a Microsoft.PowerShell.PSResourceGet/RepositoryList resource so that the full set of registered repositories can be declared in one instance, in the same way PSResourceList does for resources.

Example of what a PSResource instance could look like:

resources:
- name: Pester
  type: Microsoft.PowerShell.PSResourceGet/PSResource
  properties:
    name: Pester
    version: '[5.0.0, 6.0.0)'
    repositoryName: PSGallery
    scope: CurrentUser

Proposed technical implementation details (optional)

  • Add psresource.dsc.resource.json and repositorylist.dsc.resource.json next to the existing manifests.
  • Implement get, set, test, delete, export and whatIf for both in psresourceget.ps1, reusing GetPSResourceListActions and the Repository class so the behaviour matches the list resources.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions