Add Registry Adapter and Microsoft.Windows/Personalization resource#1550
Open
SteveL-MSFT wants to merge 16 commits into
Open
Add Registry Adapter and Microsoft.Windows/Personalization resource#1550SteveL-MSFT wants to merge 16 commits into
Microsoft.Windows/Personalization resource#1550SteveL-MSFT wants to merge 16 commits into
Conversation
added 10 commits
May 29, 2026 17:01
41f6226 to
e604361
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Windows Registry adapter (Microsoft.Windows.Adapter/Registry) plus an inline content shape for adapted resource manifests so adapters can receive structured mapping data directly. Uses the new mechanism to ship a Microsoft.Windows/Personalization adapted resource, and refactors command invocation in dsc-lib to pass DscResource directly instead of a separate CommandResourceInfo struct.
Changes:
- New manifest enum
AdaptedPathOrContent(path or inlinecontent), plumbed through discovery and stored onDscResource.adapted_content; newadaptedContentArgarg kind for get/set/delete;Adapter.listmade optional. - New registry adapter (
adapter.rs,adaptersubcommand, locale strings, manifest entry, error type) with JSON↔registry conversions for a subset of value types. - New
Microsoft.Windows/Personalizationadapted YAML manifest, project data, and Pester get/set/export tests; refactor ofcommand_resource.rs/extensions/discover.rsto dropCommandResourceInfo;get_schemanow prefers the target resource’s schema.
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/dsc-lib/src/dscresources/adapted_resource_manifest.rs | Adds AdaptedPathOrContent enum and flattens into manifest. |
| lib/dsc-lib/src/dscresources/dscresource.rs | Adds adapted_content field to DscResource. |
| lib/dsc-lib/src/dscresources/resource_manifest.rs | Adds AdaptedContent arg kinds; makes Adapter.list optional. |
| lib/dsc-lib/src/dscresources/command_resource.rs | Drops CommandResourceInfo, threads DscResource directly; handles new arg kinds; reworks get_schema. |
| lib/dsc-lib/src/discovery/command_discovery.rs | Loads content vs path; gates list invocation on optional list. |
| lib/dsc-lib/src/extensions/discover.rs | Switches to passing a DscResource for arg processing. |
| lib/dsc-lib/locales/en-us.toml | Adds noAdaptedContent localization string. |
| lib/dsc-lib-jsonschema/.versions.json | Bumps latest patch to V3_2_1. |
| tools/test_group_resource/src/main.rs | Initializes new adapted_content field. |
| resources/registry/Cargo.toml, Cargo.lock | Version bump to 1.1.0. |
| resources/registry/src/main.rs | Wires up new adapter subcommand. |
| resources/registry/src/args.rs | Adds AdapterSubCommand and SubCommand::Adapter. |
| resources/registry/src/adapter.rs | New adapter implementation and JSON↔registry conversions. |
| resources/registry/src/error.rs | New RegistryResourceError type. |
| resources/registry/registry.dsc.manifests.json | Adds Microsoft.Windows.Adapter/Registry adapter manifest. |
| resources/registry/locales/en-us.toml | Adds adapter localization strings. |
| resources/windows_personalization/windows_personalization.dsc.adaptedResource.yaml | New Personalization adapted resource with content map and embedded schema. |
| resources/windows_personalization/.project.data.json | Build copy-files entry for Windows. |
| resources/windows_personalization/personalization_{get,set,export}.tests.ps1 | New Pester tests for the Personalization resource. |
Microsoft.Windows/Personalization resource
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
validatefunction of adapterDscResourceinstead of a different structCommandResourceInfowhen invoking a native resource as information for specific arg types comes from the resource properties, this simplifies the code and future extensibility (basically all thecommand_resourcechanges are this which was needed to add the newadaptedContentArgtypecontentproperty that can be used in adapted resource manifest instead ofpathto have inline structured content for an adapteradaptermode to Registry resource that uses thiscontentpropertyMicrosoft.Windows/Personalizationresource that uses the registry adapterPersonalizationresource. More conversions will be added if we have real use cases for them.The
Microsoft.Windows/Personalizationadapted resource manifest best shows how to use this adapter:The
contentis used by the registry adapter to map the JSON to registry key path/value/valueName/type. There is also a default value used if the key or value doesn't exist in the registry. The JSONSchema is used to enforce what is allowed.PR Context