Skip to content

Commit 98e7099

Browse files
authored
Merge branch 'PowerShell:main' into win_psDscAdapter-PSCredentials-fix-ScriptDSC
2 parents cd5df41 + 8503b80 commit 98e7099

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2592
-281
lines changed

.pipelines/DSC-Official.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ variables:
2929
- group: DSC-Rust.SDK
3030
- name: officialBuild
3131
value: ${{ parameters.OfficialBuild }}
32+
- name: PublishToStore
33+
value: ${{ parameters.PublishToStore }}
3234

3335
resources:
3436
repositories:

.vscode/schemas/definitions.json

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@
1919
"required": ["Name", "Kind"],
2020
"unevaluatedProperties": false,
2121
"properties": {
22-
"Name": { "$ref": "#/$defs/ProjectName" },
23-
"Kind": { "$ref": "#/$defs/ProjectKind" },
24-
"SupportedPlatformOS": { "$ref": "#/$defs/ProjectSupportedPlatformOS" },
25-
"IsRust": { "$ref": "#/$defs/ProjectIsRust" },
26-
"TestOnly": { "$ref": "#/$defs/ProjectTestOnly" },
27-
"SkipTest": { "$ref": "#/$defs/ProjectSkipTest" },
28-
"ClippyUnclean": { "$ref": "#/$defs/ProjectClippyUnclean" },
29-
"Binaries": { "$ref": "#/$defs/ProjectBinaries" },
30-
"CopyFiles": { "$ref": "#/$defs/ProjectCopyFiles" }
22+
"Name": { "$ref": "#/$defs/ProjectName" },
23+
"Kind": { "$ref": "#/$defs/ProjectKind" },
24+
"SupportedPlatformOS": { "$ref": "#/$defs/ProjectSupportedPlatformOS" },
25+
"IsRust": { "$ref": "#/$defs/ProjectIsRust" },
26+
"TestOnly": { "$ref": "#/$defs/ProjectTestOnly" },
27+
"SkipTest": { "$ref": "#/$defs/ProjectSkipTest" },
28+
"ClippyUnclean": { "$ref": "#/$defs/ProjectClippyUnclean" },
29+
"ClippyPedanticUnclean": { "$ref": "#/$defs/ProjectClippyPedanticUnclean" },
30+
"Binaries": { "$ref": "#/$defs/ProjectBinaries" },
31+
"CopyFiles": { "$ref": "#/$defs/ProjectCopyFiles" }
3132
},
3233
"allOf": [
3334
{
@@ -65,15 +66,16 @@
6566
"required": ["Name", "Kind"],
6667
"unevaluatedProperties": false,
6768
"properties": {
68-
"Name": { "$ref": "#/$defs/ProjectName" },
69-
"Kind": { "$ref": "#/$defs/ProjectKind" },
70-
"SupportedPlatformOS": { "$ref": "#/$defs/ProjectSupportedPlatformOS" },
71-
"IsRust": { "$ref": "#/$defs/ProjectIsRust" },
72-
"TestOnly": { "$ref": "#/$defs/ProjectTestOnly" },
73-
"SkipTest": { "$ref": "#/$defs/ProjectSkipTest" },
74-
"ClippyUnclean": { "$ref": "#/$defs/ProjectClippyUnclean" },
75-
"Binaries": { "$ref": "#/$defs/ProjectBinaries" },
76-
"CopyFiles": { "$ref": "#/$defs/ProjectCopyFiles" }
69+
"Name": { "$ref": "#/$defs/ProjectName" },
70+
"Kind": { "$ref": "#/$defs/ProjectKind" },
71+
"SupportedPlatformOS": { "$ref": "#/$defs/ProjectSupportedPlatformOS" },
72+
"IsRust": { "$ref": "#/$defs/ProjectIsRust" },
73+
"TestOnly": { "$ref": "#/$defs/ProjectTestOnly" },
74+
"SkipTest": { "$ref": "#/$defs/ProjectSkipTest" },
75+
"ClippyUnclean": { "$ref": "#/$defs/ProjectClippyUnclean" },
76+
"ClippyPedanticUnclean": { "$ref": "#/$defs/ProjectClippyPedanticUnclean" },
77+
"Binaries": { "$ref": "#/$defs/ProjectBinaries" },
78+
"CopyFiles": { "$ref": "#/$defs/ProjectCopyFiles" }
7779
}
7880
},
7981
"BuildPackageFiles": {
@@ -226,6 +228,12 @@
226228
"title": "Clippy Unclean",
227229
"markdownDescription": "Indicates whether to skip linting the Rust crate with Clippy."
228230
},
231+
"ProjectClippyPedanticUnclean": {
232+
"type": "boolean",
233+
"default": false,
234+
"title": "Clippy Pedantic Unclean",
235+
"markdownDescription": "Indicates whether to skip linting the pedantic rules for the Rust crate with Clippy."
236+
},
229237
"ProjectBinaries": {
230238
"type": "array",
231239
"title": "Project Binaries",

Cargo.lock

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

Cargo.toml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ members = [
66
"dsc",
77
"lib/dsc-lib",
88
"lib/dsc-lib-jsonschema",
9+
"lib/dsc-lib-jsonschema-macros",
910
"resources/dscecho",
1011
"lib/dsc-lib-osinfo",
1112
"resources/osinfo",
@@ -29,6 +30,7 @@ default-members = [
2930
"dsc",
3031
"lib/dsc-lib",
3132
"lib/dsc-lib-jsonschema",
33+
"lib/dsc-lib-jsonschema-macros",
3234
"resources/dscecho",
3335
"lib/dsc-lib-osinfo",
3436
"resources/osinfo",
@@ -54,6 +56,7 @@ Windows = [
5456
"dsc",
5557
"lib/dsc-lib",
5658
"lib/dsc-lib-jsonschema",
59+
"lib/dsc-lib-jsonschema-macros",
5760
"resources/dscecho",
5861
"lib/dsc-lib-osinfo",
5962
"resources/osinfo",
@@ -74,6 +77,7 @@ macOS = [
7477
"dsc",
7578
"lib/dsc-lib",
7679
"lib/dsc-lib-jsonschema",
80+
"lib/dsc-lib-jsonschema-macros",
7781
"resources/dscecho",
7882
"lib/dsc-lib-osinfo",
7983
"resources/osinfo",
@@ -91,6 +95,7 @@ Linux = [
9195
"dsc",
9296
"lib/dsc-lib",
9397
"lib/dsc-lib-jsonschema",
98+
"lib/dsc-lib-jsonschema-macros",
9499
"resources/dscecho",
95100
"lib/dsc-lib-osinfo",
96101
"resources/osinfo",
@@ -130,6 +135,8 @@ clap_complete = { version = "4.5" }
130135
crossterm = { version = "0.29" }
131136
# dsc
132137
ctrlc = { version = "3.5" }
138+
# dsc-lib-jsonschema-macros
139+
darling = { version = "0.23" }
133140
# dsc-lib
134141
derive_builder = { version = "0.20" }
135142
# dsc, dsc-lib
@@ -147,15 +154,19 @@ nix = { version = "0.30" }
147154
# dsc-lib
148155
num-traits = { version = "0.2" }
149156
# dsc-lib-osinfo
150-
os_info = { version = "3.13" }
157+
os_info = { version = "3.14" }
151158
# dsc, dsc-lib
152159
path-absolutize = { version = "3.1" }
160+
# dsc-lib-jsonschema-macros
161+
proc-macro2 = { version = "1.0" }
162+
# dsc-lib-jsonschema-macros
163+
quote = { version = "1.0" }
153164
# dsc, dsc-lib
154165
regex = { version = "1.12" }
155166
# registry, dsc-lib-registry
156167
registry = { version = "1.3" }
157168
# dsc
158-
rmcp = { version = "0.9" }
169+
rmcp = { version = "0.11" }
159170
# dsc_lib
160171
rt-format = { version = "0.3" }
161172
# dsc, dsc-lib, dscecho, registry, dsc-lib-registry, runcommandonset, sshdconfig
@@ -170,6 +181,8 @@ serde = { version = "1.0", features = ["derive"] }
170181
serde_json = { version = "1.0", features = ["preserve_order"] }
171182
# dsc, dsc-lib, y2j
172183
serde_yaml = { version = "0.9" }
184+
# dsc-lib-jsonschema-macros
185+
syn = { version = "2.0" }
173186
# dsc, y2j
174187
syntect = { version = "5.3", features = ["default-fancy"], default-features = false }
175188
# dsc, process
@@ -197,7 +210,7 @@ tree-sitter-rust = { version = "0.24" }
197210
# registry, dsc-lib-registry
198211
utfx = { version = "0.1" }
199212
# dsc-lib
200-
uuid = { version = "1.18", features = ["v4"] }
213+
uuid = { version = "1.19", features = ["v4"] }
201214
# dsc-lib, dsc-lib-jsonschema
202215
url = { version = "2.5" }
203216
# dsc-lib, dsc-lib-jsonschema
@@ -218,6 +231,7 @@ pretty_assertions = { version = "1.4.1" }
218231
# Workspace crates as dependencies
219232
dsc-lib = { path = "lib/dsc-lib" }
220233
dsc-lib-jsonschema = { path = "lib/dsc-lib-jsonschema" }
234+
dsc-lib-jsonschema-macros = { path = "lib/dsc-lib-jsonschema-macros" }
221235
dsc-lib-osinfo = { path = "lib/dsc-lib-osinfo" }
222236
dsc-lib-security_context = { path = "lib/dsc-lib-security_context" }
223237
tree-sitter-dscexpression = { path = "grammars/tree-sitter-dscexpression" }

adapters/wmi/Tests/wmi.tests.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,16 @@ Describe 'WMI adapter resource tests' {
108108
$res.afterState.VariableValue | Should -Be 'update'
109109
$res.afterState.UserName | Should -Be ("{0}\{1}" -f $env:USERDOMAIN, $env:USERNAME)
110110
}
111+
112+
It 'Get works with read-only properties on Win32_ComputerSystem' -Skip:(!$IsWindows) {
113+
$manufacturer = (Get-CimInstance -ClassName Win32_ComputerSystem).Manufacturer
114+
$i = @{
115+
Manufacturer = $manufacturer
116+
} | ConvertTo-Json
117+
118+
$r = dsc resource get -r root.cimv2/Win32_ComputerSystem -i $i
119+
$LASTEXITCODE | Should -Be 0
120+
$res = $r | ConvertFrom-Json
121+
$res.actualState.Manufacturer | Should -Be $manufacturer
122+
}
111123
}

0 commit comments

Comments
 (0)