Skip to content

Specification: Native DSC v3 Resources in WinGet Client - #6291

Draft
denelon wants to merge 2 commits into
microsoft:masterfrom
denelon:spec/dsc-resource-implementation
Draft

Specification: Native DSC v3 Resources in WinGet Client#6291
denelon wants to merge 2 commits into
microsoft:masterfrom
denelon:spec/dsc-resource-implementation

Conversation

@denelon

@denelon denelon commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

📖 Description

Specification for native DSC v3 command-based resources shipped with the WinGet client. Extends the existing winget dsc infrastructure (which already provides Package, Source, UserSettings, and AdminSettings resources) with enhanced capabilities and new resources.

Key aspects:

  • Enhanced Package resource — supports both single-package mode (id) and declarative list mode (packages array) for managing sets of packages as desired state
  • New Pin resource — manages package pinning (pinning, blocking, gating) via DSC
  • Existing resources documented — UserSettings, AdminSettings (requires elevation), Source
  • Resource manifests (.dsc.json) enable DSC v3 discovery without spawning WinGet

Changes addressing review feedback (June 22):

  • Merged PackageList into Package resource — uses packages array for list mode (simpler surface area per Trenly's suggestion)
  • Documented existing AdminSettings resource — requires securityContext: elevated, is a separate resource from UserSettings
  • Acknowledged that winget dsc already exists as the DSC v3 resource protocol handler; reframed spec as extending existing infrastructure
  • Updated resource table to distinguish existing, enhanced, and new resources

Authored with GitHub Copilot assistance.

🔗 References

Related Issues:

🔍 Validation

Spec document — no code changes to validate.

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task
Microsoft Reviewers: Open in CodeFlow

Specification for native command-based DSC v3 resources shipped with
the WinGet client, including Package, PackageList, Source, Settings,
and Pin resources. Eliminates ~92s adapter overhead per resource.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| Resource Type | Purpose | DSC Operations |
|--------------|---------|----------------|
| `Microsoft.WinGet/Package` | Single package desired state | Get, Set, Test |
| `Microsoft.WinGet/PackageList` | Declarative list of packages | Get, Set, Test |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like this could just be an extension of Microsoft.WinGet/Package where the parameters could be lists instead of single values, or settings is itself a list type?

| `ensure` | enum | No | `present` \| `absent` |
| `trustLevel` | enum | No | `none` \| `trusted` |

### Microsoft.WinGet/Settings

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do admin settings get set?

winget dsc list # List available resources
```

The `winget dsc` subcommand is NOT intended for direct user interaction — it implements the DSC v3 protocol for the runtime to invoke. It does not appear in `winget --help` by default (hidden command, visible with `--verbose`).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

winget dsc is currently an alias for winget configure

- Merge PackageList into Package (list mode via 'packages' array, single via 'id')
- Document existing AdminSettings resource (requires elevation, separate from UserSettings)
- Acknowledge existing winget dsc infrastructure; reframe spec as extending it
- Clarify resource table: existing vs enhanced vs new resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

@check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, or 📝 job summary for details.

Unrecognized words (1)

sideload

These words are not needed and should be removed AAD ABCD abi ACL'd AMap Amd appdata ARMNT asan Baz bitmask bluetooth boundparms brk Buf certs cgi CMSG codepage commandline constexpr Cov cswinrt CTL Dbg Dcom decompressor dedupe DEFT devhome Dns dsc ERANGE errcode errmsg errstr filemode Finalizers FULLWIDTH fuzzer GES github Hackathon HINSTANCE hlocal hmac Hyperlink ICONDIR icu idx img inet Intelli iwr JDK LCID lhs LONGLONG LPBYTE LPCWSTR LPDWORD LPSTR LPVOID LPWSTR MAJORVERSION MAXLENGTH maxvalue MDs MINORVERSION mta nlohmann NONAME NOUPDATE NTFS ofile oid oop OPTOUT outfile OUTOFMEMORY PARAMETERMAP pdb PDWORD pid PKCS pkix placeholders positionals posix pscustomobject pseudocode PSHOST publickey qword redirector regexes remoting reparse REQS rhs rowid RTTI runspace runtimes SARL savepoint Scm sid Sideload sqlite subdir subkey trimstart ttl typedef uninitialize uninstallation UNMARSHALING userprofile versioned Webserver website wildcards winreg WMI workaround Wpp wsl

To accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands

... in a clone of the git@github.com:denelon/winget-cli.git repository
on the spec/dsc-resource-implementation branch (ℹ️ how do I use this?):

curl -s -S -L 'https://github.com/ghraw/check-spelling/check-spelling/v0.0.26/apply.pl' |
perl - 'https://github.com/microsoft/winget-cli/actions/runs/27973549040/attempts/1' &&
git commit -m 'Update check-spelling metadata'

Pattern suggestions ✂️ (2)

You could add these patterns to .github/actions/spelling/patterns.txt:

# Automatically suggested patterns

# hit-count: 1 file-count: 1
# assign regex
= /[^*].*?(?:[a-z]{3,}|[A-Z]{3,}|[A-Z][a-z]{2,}).*/[gi]?(?=\W|$)

# hit-count: 1 file-count: 1
# regex choice
\(\?:[^)]+\|[^)]+\)

Alternatively, if a pattern suggestion doesn't make sense for this project, add a # to the beginning of the line in the candidates file with the pattern to stop suggesting it.

Warnings and Notices ⚠️ (2)

See the 📂 files view, the 📜action log, or 📝 job summary for details.

⚠️ Warnings and Notices Count
ℹ️ candidate-pattern 2
⚠️ unexpected-line-ending 2

See ⚠️ Event descriptions for more information.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.


The `winget dsc` subcommand is NOT intended for direct user interaction — it implements the DSC v3 protocol for the runtime to invoke. It does not appear in `winget --help` by default (hidden command, visible with `--verbose`).
> [!NOTE]
> `winget dsc` previously served as an alias for `winget configure`. With the existing resource protocol implementation in the client, `winget dsc` is now the dedicated entry point for DSC v3 resource operations. It is NOT intended for direct user interaction — it implements the DSC v3 protocol for the runtime to invoke. It does not appear in `winget --help` by default (hidden command, visible with `--verbose`).

@Trenly Trenly Jun 22, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be a breaking change? What about winget dscv3 as the canonical entry point? Isn't this the already-existing point anyways?

image

"description": "Manage a single WinGet package",
"get": {
"executable": "winget",
"args": ["dsc", "get", "--resource", "Package"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These aren't the correct args for winget - I believe the correct args are ["dscv3", "package", "--get"]

Use winget dscv3 package --manifest to get the actual manifest values

| `scope` | enum | No | `machine` \| `user` |
| `ensure` | enum | No | `present` (default) \| `absent` \| `latest` |
| `enforcement` | enum | No | List mode only: `present` (default) \| `exact` |
| `installerType` | string | No | Preferred installer type |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really a preference, or does it act as a requirement?


**Set behavior in list mode:**
1. For each package in the list, evaluate individually
2. MSIX packages may be installed concurrently (up to 6 concurrent, matching existing WinGet behavior)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not existing behavior - reference the specification in #6295 instead


Admin settings are distinct from user settings — they control machine-wide WinGet behaviors and require administrator privileges to modify.

### Microsoft.WinGet/Pin

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also be capable of taking a list, similar to the packages resource? Since it's a new resource, it could take only a list


### CLI Commands Affected

The `winget dsc` subcommand already exists and implements the DSC v3 command-based resource protocol:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not true - winget dsc is the equivalent of winget configure; The correct command which implements the resource protocol is winget dscv3

Comment on lines +286 to +290
winget dsc get --resource <type> # stdin: JSON, stdout: current state
winget dsc set --resource <type> # stdin: JSON, stdout: result
winget dsc test --resource <type> # stdin: JSON, stdout: test result
winget dsc schema --resource <type> # stdout: JSON schema
winget dsc list # List available resources

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are not correct - the implementation is winget dscv3 package --get or winget dscv3 source --test or winget dscv3 user-settings-file --manifest

The existing implementations should be respected and expanded upon for new types, not reworked

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Needs-Author-Feedback Issue needs attention from issue or PR author label Jul 28, 2026
> The resource operates in **single mode** when `id` is specified, and **list mode** when `packages` is specified. These are mutually exclusive — specifying both is an error.

**Test behavior:**
- `ensure: present` — true if package is installed with version matching constraint

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if you want to fully align with the semantics of Microsoft DSC, but then I would introduce _exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs-Author-Feedback Issue needs attention from issue or PR author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants