@@ -70,7 +70,161 @@ changes since the last release, see the [diff on GitHub][unreleased].
70
70
for the `v3.0.0.0-alpha.5` release. Leave the release links under the release section.
71
71
-->
72
72
73
+ ### Added
74
+
75
+ - Added the [ ` --what-if ` (` -w ` )] [ ur-aa ] option to the [ dsc config set] [ cmd-cset ] command. When you
76
+ call ` dsc config set ` with the ` --what-if ` option, DSC doesn't actually invoke the resources to
77
+ enforce the desired state. Instead, it returns the expected output for the command, showing the
78
+ before and after state for each resource instance.
79
+
80
+ The output for the ` dsc config set ` operation with the ` --what-if ` operation is the same as an
81
+ [ actual configuration set operation] [ ur-ab ] , except that the metadata field
82
+ [ executionType] [ ur-ac ] is set to ` WhatIf ` instead of ` Actual ` .
83
+
84
+ In this release, the generated output is synthetic, based on the results of the resources' ` test `
85
+ operation. In the future, resources will be able to participate in what-if operations, reporting
86
+ more specifically how they will change the system. For example, participating resources could
87
+ indicate whether an actual set operation will require a reboot or whether the current user has
88
+ the correct permissions to manage that resource instance.
89
+
90
+ <details ><summary >Related work items</summary >
91
+
92
+ - Issues: [ #70 ] [ #70 ]
93
+ - PRs: [ #400 ] [ #400 ]
94
+
95
+ </details >
96
+
97
+ - Added support for [ importer resources] [ ur-ad ] . These resources resolve external sources to a
98
+ nested DSC Configuration document. The resolved instances are processed as nested resource
99
+ instances.
100
+
101
+ This required some updates to the schemas, all backwards-compatible:
102
+
103
+ - Added a new [ resourceKind] [ ur-ae ] named ` Import ` .
104
+ - Added the [ resolve] [ ur-af ] command to resource manifests.
105
+ - Added the new [ ` Resolve ` ] [ ur-ag ] capability, returned in the output for the
106
+ [ dsc resource list] [ cmd-rlist ] command when DSC discovers an importer resource.
107
+
108
+ <details ><summary >Related work items</summary >
109
+
110
+ - Issues: [ #429 ] [ #429 ]
111
+ - PRs: [ #412 ] [ #412 ]
112
+
113
+ </details >
114
+
115
+ - Added the ` Microsoft.DSC/Include ` importer resource to resolve instances from an external
116
+ configuration document. The resolved instances are processed as nested instances for the
117
+ ` Microsoft.DSC/Include ` resource instance.
118
+
119
+ You can use this resource to write smaller configuration documents and compose them as needed.
120
+ For example, you could define a security baseline and a web server configuration separately, then
121
+ combine them for a given application:
122
+
123
+ ``` yaml
124
+ $schema : &schema https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
125
+ resources :
126
+ # Group of included baseline configurations
127
+ - name : Baselines
128
+ type : Microsoft.DSC/Group
129
+ properties :
130
+ $schema : *schema
131
+ resources :
132
+ - name : Security Baseline
133
+ type : Microsoft.DSC/Include
134
+ properties :
135
+ configurationFile : security_baseline.dsc.yaml
136
+ parametersFile : security_baseline.parameters.yaml
137
+ - name : Web Server Baseline
138
+ type : Microsoft.DSC/Include
139
+ properties :
140
+ configurationFile : web_baseline.dsc.yaml
141
+ parametersFile : web_baseline.parameters.yaml
142
+ dependsOn :
143
+ - " [resourceId('Microsoft.DSC/Include', 'Security Baseline')]"
144
+
145
+ # application configuration instances, all depend on the baselines
146
+ - name : Application configuration
147
+ type : MyApp/Settings
148
+ properties :
149
+ someSetting : someValue
150
+ dependsOn :
151
+ - " [resourceId('Microsoft.DSC/Group', 'Baselines')]"
152
+ ` ` `
153
+
154
+ <details><summary>Related work items</summary>
155
+
156
+ - Issues: [#429][#429]
157
+ - PRs: [#412][#412]
158
+
159
+ </details>
160
+
161
+ - Added caching for PowerShell Desired State Configuration (PSDSC) resources when using the
162
+ ` Microsoft.DSC/PowerShell` and `Microsoft.Windows/PowerShell` adapters. The adapters use the
163
+ cache to speed up resource discovery. The performance improvement reduced the resource list time
164
+ under tests from eight seconds to two seconds, and reduced invocation operation times by half.
165
+
166
+ The adapters cache the resources in the following locations, depending on your platform :
167
+
168
+ | Adapter | Platform | Path |
169
+ | :---------------------------- : | :------: | :---------------------------------------------- |
170
+ | `Microsoft.DSC/PowerShell` | Linux | `$HOME/.dsc/PSAdapterCache.json` |
171
+ | `Microsoft.DSC/PowerShell` | macOS | `$HOME/.dsc/PSAdapterCache.json` |
172
+ | `Microsoft.DSC/PowerShell` | Windows | `%LOCALAPPDATA%\dsc\PSAdapterCache.json` |
173
+ | `Microsoft.Windows/PowerShell` | Windows | `%LOCALAPPDATA%\dsc\WindowsPSAdapterCache.json` |
174
+
175
+ The adapters check whether the cache is stale on each run and refresh it if :
176
+
177
+ - The `PSModulePath` environmental variable is updated.
178
+ - Any module is added or removed from the `PSModulePath`.
179
+ - Any related files in a cached PSDSC resource module has been updated since the cache was
180
+ written. The adapter watches the `LastWriteTime` of module files with the following extensions :
181
+ ` .ps1` , `.psd1`, `.psm1`, and `.mof`.
182
+
183
+ <details><summary>Related work items</summary>
184
+
185
+ - Issues : [#371][#371]
186
+ - PRs : [#432][#432]
187
+
188
+ </details>
189
+
190
+ - Added the `DSC.PackageManagement/Apt` resource for managing software on systems that use the
191
+ advanced package tool (APT). In this release, you can use the resource to :
192
+
193
+ - Install the latest version of a package.
194
+ - Uninstall a package.
195
+ - Get the current state of a package.
196
+ - Export every installed package as a DSC resource instance.
197
+
198
+ <details><summary>Related work items</summary>
199
+
200
+ - Issues : _None_.
201
+ - PRs : [#434][#434]
202
+
203
+ </details>
204
+
205
+
206
+ # ## Fixed
207
+
208
+ - Fixed the JSON Schema for [exit codes][ur-fa] in the resource manifest to support negative
209
+ integers. Prior to this release, the DSC engine supported negative exit codes but the JSON Schema
210
+ forbid them.
211
+
212
+ <details><summary>Related work items</summary>
213
+
214
+ - Issues : [#407][#407]
215
+ - PRs : [#410][#410]
216
+
217
+ </details>
218
+
73
219
<!-- Unreleased change links -->
220
+ [ur-aa] : ./docs/reference/cli/config/set.md#-w---what-if
221
+ [ur-ab] : ./docs/reference/schemas/outputs/config/set.md
222
+ [ur-ac] : ./docs/reference/schemas/metadata/Microsoft.DSC/properties.md#executiontype
223
+ [ur-ad] : ./docs/reference/schemas/definitions/resourceKind.md#importer-resources
224
+ [ur-ae] : ./docs/reference/schemas/definitions/resourceKind.md
225
+ [ur-af] : ./docs/reference/schemas/resource/manifest/resolve.md
226
+ [ur-ag] : ./docs/reference/schemas/outputs/resource/list.md#capability-resolve
227
+ [ur-fa] : ./docs/reference/schemas/resource/manifest/root.md#exitcodes
74
228
75
229
# # [v3.0.0-preview.7][release-v3.0.0-preview.7] - 2024-04-22
76
230
@@ -1318,6 +1472,7 @@ For the full list of changes in this release, see the [diff on GitHub][compare-v
1318
1472
[#362]: https://github.com/PowerShell/DSC/issues/362
1319
1473
[#364]: https://github.com/PowerShell/DSC/issues/364
1320
1474
[#368]: https://github.com/PowerShell/DSC/issues/368
1475
+ [#371]: https://github.com/PowerShell/DSC/issues/371
1321
1476
[#373]: https://github.com/PowerShell/DSC/issues/373
1322
1477
[#375]: https://github.com/PowerShell/DSC/issues/375
1323
1478
[#376]: https://github.com/PowerShell/DSC/issues/376
@@ -1327,11 +1482,19 @@ For the full list of changes in this release, see the [diff on GitHub][compare-v
1327
1482
[#385]: https://github.com/PowerShell/DSC/issues/385
1328
1483
[#388]: https://github.com/PowerShell/DSC/issues/388
1329
1484
[#397]: https://github.com/PowerShell/DSC/issues/397
1485
+ [#400]: https://github.com/PowerShell/DSC/issues/400
1330
1486
[#401]: https://github.com/PowerShell/DSC/issues/401
1331
1487
[#405]: https://github.com/PowerShell/DSC/issues/405
1488
+ [#407]: https://github.com/PowerShell/DSC/issues/407
1489
+ [#410]: https://github.com/PowerShell/DSC/issues/410
1490
+ [#412]: https://github.com/PowerShell/DSC/issues/412
1491
+ [#429]: https://github.com/PowerShell/DSC/issues/429
1492
+ [#432]: https://github.com/PowerShell/DSC/issues/432
1493
+ [#434]: https://github.com/PowerShell/DSC/issues/434
1332
1494
[#45]: https://github.com/PowerShell/DSC/issues/45
1333
1495
[#49]: https://github.com/PowerShell/DSC/issues/49
1334
1496
[#57]: https://github.com/PowerShell/DSC/issues/57
1497
+ [#70]: https://github.com/PowerShell/DSC/issues/70
1335
1498
[#73]: https://github.com/PowerShell/DSC/issues/73
1336
1499
[#75]: https://github.com/PowerShell/DSC/issues/75
1337
1500
[#89]: https://github.com/PowerShell/DSC/issues/89
0 commit comments