Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion docs/reference/resources/Microsoft/Windows/Registry/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,19 @@ resources:
## Description

The `Microsoft.Windows/Registry` resource enables you to idempotently manage registry keys and
values. The resource can:
values. DSC invokes the resource over a reusable JSON-RPC process by default. When resource reuse
is disabled, DSC uses the existing executable commands instead. You can also continue to invoke
the `registry config` commands directly. The resource can:

- Add and remove registry keys.
- Add, update, and remove registry values.
- Retrieve and configure registry key access control lists (ACLs).

The companion `Microsoft.Windows/RegistryList` resource also supports JSON-RPC for `get`, `set`,
what-if, and schema operations. It processes the entries in `registryEntries` in order, including
entries with `_exist: false`. A list-level `registryFilePath` applies to entries that don't specify
their own offline hive file path.

> [!NOTE]
> This resource is installed with DSC itself on Windows systems.
>
Expand Down
12 changes: 12 additions & 0 deletions resources/registry/locales/en-us.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ emptyReverseMap = "The reverse map is empty"
mapJsonToRegistryNotFound = "No mapping found for key: %{key}"

[args]
jsonrpcAbout = "Serve resource operations over JSON-RPC."
about = "Manage state of Windows registry"
adapterAbout = "Use adapted registry resources."
adapterArgsInputHelp = "The registry JSON input for the adapted resource."
Expand Down Expand Up @@ -56,3 +57,14 @@ tracingInitError = "Unable to set global default tracing subscriber. Tracing is
debugAttach = "attach debugger to pid %{pid} and press any key to continue"
debugEventReadError = "Error: Failed to read event: %{err}"
debugEventUnexpectedError = "Unexpected event: %{e}"

[jsonrpc]
invalidRequest = "Invalid JSON-RPC request."
invalidParams = "Invalid JSON-RPC parameters."
methodNotFound = "Unknown JSON-RPC method: %{method}"
invalidLifecycle = "The JSON-RPC method is not valid in the current lifecycle state."
unsupportedVersion = "No supported JSON-RPC resource protocol version was requested."
unsupportedResource = "Unsupported JSON-RPC resource type: %{resource}"
unsupportedOperation = "Unsupported JSON-RPC resource operation: %{operation}"
unexpectedEnd = "JSON-RPC input ended before the exit notification."
unexpectedExit = "JSON-RPC exit requires a successful shutdown."
15 changes: 15 additions & 0 deletions resources/registry/registry.dsc.manifests.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
"Windows"
],
"version": "1.0.0",
"jsonrpc": {
"executable": "registry",
"args": [
"jsonrpc"
]
},
"get": {
"executable": "registry",
"args": [
Expand All @@ -20,6 +26,7 @@
]
},
"set": {
"supportsWhatIf": true,
"executable": "registry",
"args": [
"config",
Expand All @@ -35,6 +42,7 @@
"whatIfReturns": "state"
},
"delete": {
"supportsWhatIf": true,
"executable": "registry",
"args": [
"config",
Expand Down Expand Up @@ -72,6 +80,12 @@
"Windows"
],
"version": "1.0.0",
"jsonrpc": {
"executable": "registry",
"args": [
"jsonrpc"
]
},
"get": {
"executable": "registry",
"args": [
Expand All @@ -85,6 +99,7 @@
]
},
"set": {
"supportsWhatIf": true,
"executable": "registry",
"args": [
"config",
Expand Down
2 changes: 2 additions & 0 deletions resources/registry/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ pub enum ConfigSubCommand {

#[derive(Debug, PartialEq, Eq, Subcommand)]
pub enum SubCommand {
#[clap(name = "jsonrpc", about = t!("args.jsonrpcAbout").to_string())]
JsonRpc,
#[clap(name = "query", about = t!("args.queryAbout").to_string(), arg_required_else_help = true)]
Query {
#[clap(short, long, required = true, help = t!("args.queryArgsKeyPathHelp").to_string())]
Expand Down
Loading
Loading