Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSResourceGet DSC resources #1697

Open
ThomasNieto opened this issue Sep 10, 2024 · 3 comments
Open

PSResourceGet DSC resources #1697

ThomasNieto opened this issue Sep 10, 2024 · 3 comments

Comments

@ThomasNieto
Copy link
Contributor

Summary of the new feature / enhancement

As a user I want PSResourceGet to have DSC resources so I can declaratively manage PS resources.

Proposed technical implementation details (optional)

No response

@kilasuit
Copy link

This is essentially a reask of #211 (when this repo was for PowerShellGet and had resources delivered) but to remove needing PowerShellGet/PackageManagement going forward

@kilasuit
Copy link

Also worth noting that we have had this asked for as part of https://github.com/dsccommunity/ComputerManagementDsc with a PR currently open to add this using the older PowerShellGet/PackageManagement modules as a class resource
There's also been talk about this being something that winget provides an access layer to in the winget-cli repo as part of the configurations that winget can apply

I agree though that PSResourceGet should author and own the resources and these can then be utilised in configurations & not require duplicated functionality in the ComputerManagementDSC repo.

@Gijsreyn
Copy link

Would very much like to see this coming for several reasons. While the DSC community has tons of script-based DSC resources, movement around Microsoft modules aim towards class-based. More functionality is also build in the DSC v3 area that are not expanding to script-based ones for example the Export capability.

Take now for example when you want to bootstrap a local Windows machine. There's one simple step missing just before you start installing tools and packages through WinGet in a declarative way. To illustrate the missing step, take the code snippet below:

$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
metadata:
    Microsoft.DSC:
        securityContext: Elevated
resources:
  - name: Use class PowerShell resources
    type: Microsoft.DSC/PowerShell
    properties:
      resources:
        - name: Install WinGet PowerShell module  
          type: Microsoft.PSResourceGet.DSC/PSResourceGet # This is the missing step for triggering WinGet installation
          properties:
            Name: Microsoft.WinGet.DSC
            Repository: PSGallery
            Ensure: Present
            ReInstall: true
            RequiredVersion: 1.9.2411
        - name: PowerShell 7 Preview
          type: Microsoft.WinGet.DSC/WinGetPackage
          properties:
            Id: Microsoft.PowerShell.Preview
            Ensure: Present

PSResourceGet also removes the dependency on NuGet and is shipped with version 7.2+ if I'm not mistaken. This removes one more burden.

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

No branches or pull requests

4 participants