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).
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.
Validation
Manual verification of basics locally to ensure golden path functionality.
Updated existing tests to cover changes, including adding new fields.
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
, andWinGetPackageManager
resources were deemed acceptable in their current state. TheWinGetSources
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 newWinGetSource
resource for managing individual sources. TheWinGetPackage
resource was updated to be better in line with best practices but should still be compatible unless one was usingGet
.Change
The
WinGetSources
resource was replaced with aWinGetSource
resource that manages a single source. TheWinGetSources
resource can continue to be used by specifying one of the module versions that contains it, but once released, new configurations should prefer theWinGetSource
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:Source
as aKey
$this
in calls toGet
/Set
/Test
Get
IsInstalled
is reported viaEnsure
(true =>Present
, false =>Absent
)InstalledVersion
is reported viaVersion
IsUpdateAvailable
is reported viaUseLatest
(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:
winget configure validate
functionality to handle the newWinGetSource
resource instead ofWinGetSources
.Version
andUseLatest
to theWinGetPackage
resource.UseLatest
will override anyVersion
provided if it is true.PackageCatalogInfo::TrustLevel
property reportingNone
improperly if the internal trust level contained bothTrusted
and another flag.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