PSResourceGet
PSResourceGet copied to clipboard
PSResourceGet DSC resources
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
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
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.
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.