-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Microsoft.WinGet.DSC improvements (and breaking change) (#4795)
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: - Mark `Source` as a `Key` - Validate with existing attributes where possible - Not updating `$this` in calls to `Get`/`Set`/`Test` - Using the configurable properties to report values with `Get` - `IsInstalled` is reported via `Ensure` (true => `Present`, false => `Absent`) - `InstalledVersion` is reported via `Version` - `IsUpdateAvailable` is reported via `UseLatest` (they will have the opposite boolean value from each other) Any existing (non-`Get`) uses of the resource should continue to work as they did before. Smaller updates worth mentioning: - Updated the `winget configure validate` functionality to handle the new `WinGetSource` resource instead of `WinGetSources`. - Removed the error when giving both a `Version` and `UseLatest` to the `WinGetPackage` resource. `UseLatest` will override any `Version` provided if it is true. - Fixed a bug with COM `PackageCatalogInfo::TrustLevel` property reporting `None` improperly if the internal trust level contained both `Trusted` and another flag. - Renamed all of the enums in the module as there is no namespacing for enums/classes in PowerShell.
- Loading branch information
Showing
20 changed files
with
554 additions
and
528 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.