Skip to content

Commit e34ee27

Browse files
Export registry schemas
This change exports the registry schemas to the repository for online review without requiring a user or integrating developer to install the package and invoke the `registry schema` command.
1 parent fb5560d commit e34ee27

File tree

2 files changed

+340
-0
lines changed

2 files changed

+340
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
{
2+
"$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/resources/Microsoft.Windows/Registry/v1.0.0/schema.json",
3+
"$schema": "https://json-schema.org/draft/2020-12/schema",
4+
"title": "Microsoft.Windows/Registry instance",
5+
"description": "Manages Windows Registry keys and values.",
6+
"type": "object",
7+
"properties": {
8+
"_exist": {
9+
"title": "Exist",
10+
"description": "Defines whether the instance should exist.",
11+
"type": "boolean",
12+
"default": true
13+
},
14+
"_metadata": {
15+
"title": "Resource metadata",
16+
"description": "Defines metadata returned by the resource.",
17+
"$ref": "#/$defs/Metadata",
18+
"readOnly": true
19+
},
20+
"keyPath": {
21+
"title": "Registry key path",
22+
"description": "Defines the path to the registry key to manage. Must be prefixed with a valid hive identifier. Separate the paths with back slashes only.",
23+
"type": "string",
24+
"pattern": "^(HKCC|HKEY_CURRENT_CONFIG|HKCU|HKEY_CURRENT_USER|HKCR|HKEY_CLASSES_ROOT|HKLM|HKEY_LOCAL_MACHINE|HKU|HKEY_USERS)\\\\[a-zA-Z0-9-_\\\\]+?[^\\\\]$"
25+
},
26+
"valueData": {
27+
"title": "Registry value data",
28+
"description": "Defines the data for a registry value.",
29+
"$ref": "#/$defs/RegistryValueData"
30+
},
31+
"valueName": {
32+
"title": "Registry value name",
33+
"description": "Defines the name of the registry value to manage.",
34+
"type": "string"
35+
}
36+
},
37+
"additionalProperties": false,
38+
"dependentRequired": {
39+
"valueData": [
40+
"valueName"
41+
]
42+
},
43+
"required": [
44+
"keyPath"
45+
],
46+
"$defs": {
47+
"Metadata": {
48+
"type": "object",
49+
"properties": {
50+
"whatIf": {
51+
"title": "What-if messages",
52+
"description": "A list of messages returned by the resource when invoked in what-if mode.",
53+
"type": "array",
54+
"items": {
55+
"type": "string"
56+
},
57+
"readOnly": true
58+
}
59+
},
60+
"additionalProperties": false
61+
},
62+
"RegistryValueData": {
63+
"oneOf": [
64+
{
65+
"title": "String value data",
66+
"description": "Defines the registry value as a static string.",
67+
"type": "object",
68+
"properties": {
69+
"String": {
70+
"type": "string"
71+
}
72+
},
73+
"additionalProperties": false,
74+
"required": [
75+
"String"
76+
]
77+
},
78+
{
79+
"title": "Expandable string value data",
80+
"description": "Defines the registry value as a string with expandable references.",
81+
"type": "object",
82+
"properties": {
83+
"ExpandString": {
84+
"type": "string"
85+
}
86+
},
87+
"additionalProperties": false,
88+
"required": [
89+
"ExpandString"
90+
]
91+
},
92+
{
93+
"title": "Binary value data",
94+
"description": "Defines the registry value as an array of bytes.",
95+
"type": "object",
96+
"properties": {
97+
"Binary": {
98+
"type": "array",
99+
"items": {
100+
"type": "integer",
101+
"format": "uint8",
102+
"minimum": 0
103+
}
104+
}
105+
},
106+
"additionalProperties": false,
107+
"required": [
108+
"Binary"
109+
]
110+
},
111+
{
112+
"title": "DWord value data",
113+
"description": "Defines the registry value as an unsigned 32-bit integer.",
114+
"type": "object",
115+
"properties": {
116+
"DWord": {
117+
"type": "integer",
118+
"format": "uint32",
119+
"minimum": 0
120+
}
121+
},
122+
"additionalProperties": false,
123+
"required": [
124+
"DWord"
125+
]
126+
},
127+
{
128+
"title": "Multiple string value data",
129+
"description": "Defines the registry value as an array of static strings.",
130+
"type": "object",
131+
"properties": {
132+
"MultiString": {
133+
"type": "array",
134+
"items": {
135+
"type": "string"
136+
}
137+
}
138+
},
139+
"additionalProperties": false,
140+
"required": [
141+
"MultiString"
142+
]
143+
},
144+
{
145+
"title": "QWord value data",
146+
"description": "Defines the registry value as an unsigned 64-bit integer.",
147+
"type": "object",
148+
"properties": {
149+
"QWord": {
150+
"type": "integer",
151+
"format": "uint64",
152+
"minimum": 0
153+
}
154+
},
155+
"additionalProperties": false,
156+
"required": [
157+
"QWord"
158+
]
159+
}
160+
]
161+
}
162+
}
163+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
{
2+
"$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/resources/Microsoft.Windows/Registry/v1.0.0/schema.vscode.json",
3+
"$schema": "https://json-schema.org/draft/2020-12/schema",
4+
"title": "Microsoft.Windows/Registry instance",
5+
"description": "Manages Windows Registry keys and values.",
6+
"type": "object",
7+
"properties": {
8+
"_exist": {
9+
"title": "Exist",
10+
"description": "Defines whether the instance should exist.",
11+
"type": "boolean",
12+
"default": true,
13+
"markdownDescription": "The `_exist` property defines whether a registry key or value should exist. When this\nproperty is `true`, the resource creates the registry key or value if it doesn't exist\nduring a `set` operation. When this property is `false`, the resource deletes the registry\nkey or value if it exists during a `set` operation.\n\nThe default value is `true`."
14+
},
15+
"_metadata": {
16+
"title": "Resource metadata",
17+
"description": "Defines metadata returned by the resource.",
18+
"$ref": "#/definitions/Metadata",
19+
"markdownDescription": "The `metadata` property defines metadata returned by the resource. The registry resource\ndoesn't support sending metadata input. It returns messages when invoked in what-if mode.",
20+
"readOnly": true
21+
},
22+
"keyPath": {
23+
"title": "Registry key path",
24+
"description": "Defines the path to the registry key to manage. Must be prefixed with a valid hive identifier. Separate the paths with back slashes only.",
25+
"type": "string",
26+
"markdownDescription": "The `keyPath` property defines the path to the registry key an instance\nof the resource manages. It must be prefixed with a valid hive identifier:\n\n| Identifier | Hive |\n|:-------------------------------:|:----------------------|\n| `HKCC` or `HKEY_CURRENT_CONFIG` | Current configuration |\n| `HKCU` or `HKEY_CURRENT_USER` | Current user |\n| `HKCR` or `HKEY_CLASSES_ROOT` | Classes root |\n| `HKLM` or `HKEY_LOCAL_MACHINE` | Local machine |\n| `HKU` or `HKEY_USERS` | Users |\n\nSpecify the path to the registry key with backslashes (`\\`), like\n`HKCU\\DSC\\Properties\\keyPath\\Example`. If using JSON, ensure the\nbacklsashes are escaped, like `HKCU\\\\DSC\\\\Properties\\\\keyPath\\\\Example`.",
27+
"pattern": "^(HKCC|HKEY_CURRENT_CONFIG|HKCU|HKEY_CURRENT_USER|HKCR|HKEY_CLASSES_ROOT|HKLM|HKEY_LOCAL_MACHINE|HKU|HKEY_USERS)\\\\[a-zA-Z0-9-_\\\\]+?[^\\\\]$",
28+
"patternErrorMessage": "The value must begin with a valid hive identifier. Valid identifiers are:\nHKCC, HKEY_CURRENT_CONFIG, HKCU, HKEY_CURRENT_USER HKCR, HKEY_CLASSES_ROOT HKLM, HKEY_LOCAL_MACHINE HKU, and HKEY_USERS."
29+
},
30+
"valueData": {
31+
"title": "Registry value data",
32+
"description": "Defines the data for a registry value.",
33+
"$ref": "#/definitions/RegistryValueData",
34+
"markdownDescription": "Defines the data for a registry value. When you specify this value, you must also specify\nthe name of the registry value.\n\nDefine the data as an object with a single property. The property name determines the data\ntype and the property value determines the data value. The following table lists the\navailable data types.\n\n| Property name | Data description |\n|:--------------:|:-------------------------------------------------------------------|\n| `String` | Defines the registry value as a static string. |\n| `ExpandString` | Defines the registry value as a string with expandable references. |\n| `MultiString` | Defines the registry value as an array of static strings. |\n| `Binary` | Defines the registry value as an array of bytes. |\n| `DWord` | Defines the registry value as an unsigned 32-bit integer. |\n| `QWord` | Defines the registry value as an unsigned 64-bit integer. |"
35+
},
36+
"valueName": {
37+
"title": "Registry value name",
38+
"description": "Defines the name of the registry value to manage.",
39+
"type": "string",
40+
"markdownDescription": "The `valueName` property defines the name of the registry value to manage. This value is\nrequired when specifying value data."
41+
}
42+
},
43+
"additionalProperties": false,
44+
"dependentRequired": {
45+
"valueData": [
46+
"valueName"
47+
]
48+
},
49+
"markdownDescription": "Each instance of the `Microsoft.Windows/Registry` resource manages a registry key or value.\nYou can use it to idempotently ensure that a registry key or value exists and set the data\nfor registry values.",
50+
"required": [
51+
"keyPath"
52+
],
53+
"definitions": {
54+
"Metadata": {
55+
"type": "object",
56+
"properties": {
57+
"whatIf": {
58+
"title": "What-if messages",
59+
"description": "A list of messages returned by the resource when invoked in what-if mode.",
60+
"type": "array",
61+
"items": {
62+
"type": "string"
63+
},
64+
"markdownDescription": "Contains a list of messages returned by the resource when invoked in what-if mode, as with the `dsc config set --what-if` command.",
65+
"readOnly": true
66+
}
67+
},
68+
"additionalProperties": false
69+
},
70+
"RegistryValueData": {
71+
"oneOf": [
72+
{
73+
"title": "String value data",
74+
"description": "Defines the registry value as a static string.",
75+
"type": "object",
76+
"properties": {
77+
"String": {
78+
"type": "string"
79+
}
80+
},
81+
"additionalProperties": false,
82+
"markdownDescription": "When you define `valueData` with the `String` property, the resource sets the data for\nthe registry value as a static string. If the string contains any unexpanded references\nto environment variables, such as `%PATH%`, the references are treated as literal\ncharacters and aren't expandable.`",
83+
"required": [
84+
"String"
85+
]
86+
},
87+
{
88+
"title": "Expandable string value data",
89+
"description": "Defines the registry value as a string with expandable references.",
90+
"type": "object",
91+
"properties": {
92+
"ExpandString": {
93+
"type": "string"
94+
}
95+
},
96+
"additionalProperties": false,
97+
"markdownDescription": "When you define `valueData` with the `ExpandString` property, the resource sets the data\nfor the registry value as a string. If the string contains any unexpanded references to\nenvironment variables, such as `%PATH%`, they're expandable.",
98+
"required": [
99+
"ExpandString"
100+
]
101+
},
102+
{
103+
"title": "Binary value data",
104+
"description": "Defines the registry value as an array of bytes.",
105+
"type": "object",
106+
"properties": {
107+
"Binary": {
108+
"type": "array",
109+
"items": {
110+
"type": "integer",
111+
"format": "uint8",
112+
"minimum": 0
113+
}
114+
}
115+
},
116+
"additionalProperties": false,
117+
"markdownDescription": "When you define `valueData` with the `Binary` property, the resource sets the data for\nthe registry value as an array of bytes. You can specify the value as an empty array or\nas an array containing the integer representation of one or more bytes.",
118+
"required": [
119+
"Binary"
120+
]
121+
},
122+
{
123+
"title": "DWord value data",
124+
"description": "Defines the registry value as an unsigned 32-bit integer.",
125+
"type": "object",
126+
"properties": {
127+
"DWord": {
128+
"type": "integer",
129+
"format": "uint32",
130+
"minimum": 0
131+
}
132+
},
133+
"additionalProperties": false,
134+
"markdownDescription": "When you define `valueData` with the `DWord` property, the resource sets the data for the\nregistry value as an unsigned 32-bit integer.",
135+
"required": [
136+
"DWord"
137+
]
138+
},
139+
{
140+
"title": "Multiple string value data",
141+
"description": "Defines the registry value as an array of static strings.",
142+
"type": "object",
143+
"properties": {
144+
"MultiString": {
145+
"type": "array",
146+
"items": {
147+
"type": "string"
148+
}
149+
}
150+
},
151+
"additionalProperties": false,
152+
"markdownDescription": "When you define `valueData` with the `MultiString` property, the resource sets the data\nfor the registry value as an array of static strings. You can specify the value as an\nempty array, or as an array containing one or more strings. If any of the strings in the\narray contain any unexpanded references to environment variables, such as `%PATH%`, the\nreferences are treated as literal characters and aren't expandable.",
153+
"required": [
154+
"MultiString"
155+
]
156+
},
157+
{
158+
"title": "QWord value data",
159+
"description": "Defines the registry value as an unsigned 64-bit integer.",
160+
"type": "object",
161+
"properties": {
162+
"QWord": {
163+
"type": "integer",
164+
"format": "uint64",
165+
"minimum": 0
166+
}
167+
},
168+
"additionalProperties": false,
169+
"markdownDescription": "When you define `valueData` with the `QWord` property, the resource sets the data for the\nregistry value as an unsigned 64-bit integer.",
170+
"required": [
171+
"QWord"
172+
]
173+
}
174+
]
175+
}
176+
}
177+
}

0 commit comments

Comments
 (0)