microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.38k stars 1.46k forks source link

Microsoft.WinGet.DSC improvements (and breaking change) #4795

Closed JohnMcPMS closed 2 months ago

JohnMcPMS commented 2 months ago

The goal of this PR is to get these resources to a state where we feel ready to release the module without the prerelease tag. The WinGetUserSettings, WinGetAdminSettings, and WinGetPackageManager resources were deemed acceptable in their current state. The WinGetSources resource was decided to be overly complicated and likely not heavily used yet (and containing some bugs), so it was removed in favor of a new WinGetSource resource for managing individual sources. The WinGetPackage resource was updated to be better in line with best practices but should still be compatible unless one was using Get.

Change

The WinGetSources resource was replaced with a WinGetSource resource that manages a single source. The WinGetSources resource can continue to be used by specifying one of the module versions that contains it, but once released, new configurations should prefer the WinGetSource resource from the latest module.

While there is no way to include or discover help via the module, I documented the resources similarly to the cmdlet documentation format. These can be used as the basis for official documentation, or we can put a link to them in the PowerShell Gallery listing (maybe updating the Project Site to point to a new landing page for the DSC resources).

The updates to WinGetPackage aim to have it follow best practices and make general improvements:

Any existing (non-Get) uses of the resource should continue to work as they did before.

Smaller updates worth mentioning:

Validation

Manual verification of basics locally to ensure golden path functionality. Updated existing tests to cover changes, including adding new fields.

Microsoft Reviewers: Open in CodeFlow