WinGetPackage
Manages the installation state of packages.Properties
The package identifier. This is a key property.Example:
Microsoft.PowerToysThe source name. This is a key property that helps uniquely identify the package.Example:
wingetThe specific version to install. If not specified, installs the latest version.Example:
0.70.0Whether the package should be installed or removed. Valid values:
Present- Package should be installedAbsent- Package should be removed
How to match the package ID. Valid values:
Equals- Exact match (case sensitive)EqualsCaseInsensitive- Exact match (case insensitive)StartsWithCaseInsensitive- ID starts with the specified valueContainsCaseInsensitive- ID contains the specified value
Whether to always keep the package updated to the latest version. When true, the resource will ensure updates are installed.
The installation mode. Valid values:
Default- Use package’s default install modeSilent- Silent installationInteractive- Interactive installation
Methods
Get()- Returns the current state of the packageTest()- Tests if the package is in the desired stateSet()- Ensures the package is in the desired state
Examples
Install Package
Install Specific Version
Keep Package Updated
Remove Package
WinGetSource
Manages package sources.Properties
The source name. This is a key property.Example:
company-repoThe source URL or argument.Example:
https://packages.company.comThe source type.Example:
Microsoft.PreIndexed.PackageThe trust level for the source. Valid values:
Undefined- No trust level specifiedNone- Untrusted sourceTrusted- Trusted source
Whether the source requires explicit selection. When true, the source must be explicitly specified in commands.
The source priority. Lower numbers have higher priority.Example:
1Whether the source should exist or be removed. Valid values:
Present- Source should be configuredAbsent- Source should be removed
Methods
Get()- Returns the current state of the sourceTest()- Tests if the source is in the desired stateSet()- Ensures the source is in the desired state
Examples
Add Source
Add Source with Priority
Remove Source
WinGetUserSettings
Manages WinGet user settings in settings.json.Properties
System identifier. This is a key property. Leave empty - do not set manually.Example:
""A hashtable containing the desired settings. Settings follow the WinGet settings.json schema.
How to apply settings. Valid values:
Full- Replace all settings with the specified valuesPartial- Merge specified settings with existing settings
Methods
Get()- Returns the current user settingsTest()- Tests if settings match the desired stateSet()- Applies the desired settings
Examples
Configure Visual Settings
Disable Telemetry
Full Settings Configuration
WinGetAdminSettings
Manages WinGet administrator settings. Requires administrator privileges.Properties
System identifier. This is a key property. Leave empty - do not set manually.Example:
""A hashtable containing the desired admin settings. Keys are admin setting names, values are boolean.
Methods
Get()- Returns the current admin settingsTest()- Tests if admin settings match the desired stateSet()- Applies the desired admin settings
Examples
Enable Local Manifests
Configure Multiple Admin Settings
WinGetPackageManager
Ensures WinGet is installed and optionally at a specific version.Properties
System identifier. This is a key property. Leave empty - do not set manually.Example:
""Specific version of WinGet to install.Example:
1.6.3133Install the latest stable version of WinGet.
Install the latest pre-release version of WinGet. Takes precedence over UseLatest.
Methods
Get()- Returns the installed WinGet versionTest()- Tests if WinGet is installed at the desired versionSet()- Installs or updates WinGet to the desired version
Examples
Ensure WinGet is Installed (Latest)
Install Specific Version
Install Latest Pre-release
Complete Example Configuration
Here’s a complete example using all DSC resources:Notes
- All DSC resources are idempotent - safe to run multiple times
- Admin resources (WinGetAdminSettings, WinGetSource) require administrator privileges
- The
SIDproperty should be left as an empty string"" - Resources can be used in YAML configuration files or PowerShell DSC configurations
- Use
action: Partialfor WinGetUserSettings to merge with existing settings