Skip to content

Commit c36fafc

Browse files
authored
Merge pull request #1541 from Gijsreyn/gh-1540/main/add-windowsfeaturelist-resource
Add new `Microsoft.Windows/WindowsFeatureList` resource
2 parents 19b3058 + 5f10118 commit c36fafc

19 files changed

Lines changed: 1181 additions & 105 deletions

Cargo.lock

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ default-members = [
4848
"lib/dsc-lib-registry",
4949
"resources/runcommandonset",
5050
"lib/dsc-lib-security_context",
51-
"resources/dism_dsc",
5251
"resources/sshdconfig",
5352
"resources/WindowsUpdate",
5453
"resources/windows_service",
@@ -58,7 +57,8 @@ default-members = [
5857
"grammars/tree-sitter-dscexpression",
5958
"grammars/tree-sitter-ssh-server-config",
6059
"y2j",
61-
"xtask"
60+
"xtask",
61+
"resources/dism_dsc"
6262
]
6363

6464
[workspace.metadata.groups]

data.build.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
"windows_firewall.exe",
110110
"windows_service.exe",
111111
"windows_service.dsc.resource.json",
112+
"windows_feature.dsc.resource.json",
112113
"wmi.dsc.resource.json",
113114
"wmi.resource.ps1",
114115
"wmiAdapter.psd1",
@@ -180,7 +181,7 @@
180181
"SupportedPlatformOS": "Windows",
181182
"Binaries": ["dism_dsc"],
182183
"CopyFiles": {
183-
"Windows": ["optionalfeature.dsc.resource.json", "featureondemand.dsc.resource.json"]
184+
"Windows": ["optionalfeature.dsc.resource.json", "featureondemand.dsc.resource.json", "windows_feature.dsc.resource.json"]
184185
}
185186
},
186187
{

lib/dsc-lib-registry/src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ pub struct Registry {
3535
}
3636

3737
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)]
38-
#[serde(deny_unknown_fields)]
38+
#[serde(deny_unknown_fields, rename_all = "camelCase")]
3939
pub struct Metadata {
40-
#[serde(rename = "whatIf", skip_serializing_if = "Option::is_none")]
40+
#[serde(skip_serializing_if = "Option::is_none")]
4141
pub what_if: Option<Vec<String>>
4242
}

resources/dism_dsc/.project.data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"SupportedPlatformOS": "Windows",
66
"Binaries": ["dism_dsc"],
77
"CopyFiles": {
8-
"Windows": ["optionalfeature.dsc.resource.json", "featureondemand.dsc.resource.json"]
8+
"Windows": ["optionalfeature.dsc.resource.json", "featureondemand.dsc.resource.json", "windows_feature.dsc.resource.json"]
99
}
1010
}

resources/dism_dsc/locales/en-us.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ _version = 1
22

33
[main]
44
missingArguments = "Missing operation and resource type arguments"
5-
usage = "Usage: dism_dsc <get|set|export> <optional-feature|feature-on-demand>"
5+
usage = "Usage: dism_dsc <get|set|export> <optional-feature|feature-on-demand|windows-feature>"
66
windowsOnly = "This resource is only supported on Windows"
77
unknownOperation = "Unknown operation '%{operation}'"
8-
unknownResourceType = "Unknown resource type '%{resource_type}'. Expected 'optional-feature' or 'feature-on-demand'"
8+
unknownResourceType = "Unknown resource type '%{resource_type}'. Expected 'optional-feature', 'feature-on-demand', or 'windows-feature'"
99
errorReadingInput = "Error reading input: %{err}"
1010

1111
[get]
@@ -60,3 +60,8 @@ getCapabilitiesFailed = "DismGetCapabilities failed: HRESULT %{hr}"
6060
getCapabilityInfoFailed = "DismGetCapabilityInfo failed for '%{name}': HRESULT %{hr}"
6161
addCapabilityFailed = "DismAddCapability failed for '%{name}': HRESULT %{hr}"
6262
removeCapabilityFailed = "DismRemoveCapability failed for '%{name}': HRESULT %{hr}"
63+
64+
[windows_feature_helper]
65+
whatIfEnable = "Would enable feature '%{name}'"
66+
whatIfDisable = "Would disable feature '%{name}' (remove payload: false)"
67+
whatIfRemove = "Would remove feature '%{name}' (remove payload: true)"

0 commit comments

Comments
 (0)