Skip to content

Commit ae3897c

Browse files
authored
Merge pull request #263 from MicrosoftDocs/main
6/24/2024 PM Publish
2 parents f6ae6d7 + 3a82be7 commit ae3897c

File tree

18 files changed

+1173
-189
lines changed

18 files changed

+1173
-189
lines changed

dsc/docs-conceptual/dsc-3.0/changelog.md

Lines changed: 247 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Desired State Configuration changelog"
33
description: >-
44
A log of the changes for releases of DSCv3.
55
ms.topic: whats-new
6-
ms.date: 05/09/2024
6+
ms.date: 06/24/2024
77
---
88

99
# Changelog
@@ -46,7 +46,7 @@ This section includes a summary of user-facing changes since the last release. F
4646
changes since the last release, see the [diff on GitHub][unreleased].
4747

4848
<!-- Unreleased comparison link - always update version to match last release tag-->
49-
[unreleased]: https://github.com/PowerShell/DSC/compare/v3.0.0-preview.7...main
49+
[unreleased]: https://github.com/PowerShell/DSC/compare/v3.0.0-preview.8...main
5050

5151
<!--
5252
Unreleased change entry instructions:
@@ -73,6 +73,232 @@ changes since the last release, see the [diff on GitHub][unreleased].
7373

7474
<!-- Unreleased change links -->
7575

76+
## [v3.0.0-preview.8][release-v3.0.0-preview.8] - 2024-06-19
77+
78+
This section includes a summary of changes for the `preview.8` release. For the full list of changes
79+
in this release, see the [diff on GitHub][compare-v3.0.0-preview.8].
80+
81+
<!-- Release links -->
82+
[release-v3.0.0-preview.8]: https://github.com/PowerShell/DSC/releases/tag/v3.0.0-preview.8 "Link to the DSC v3.0.0-preview.8 release on GitHub"
83+
[compare-v3.0.0-preview.8]: https://github.com/PowerShell/DSC/compare/v3.0.0-preview.7...v3.0.0-preview.8
84+
85+
### Changed
86+
87+
- Changed the `Microsoft.DSC/PowerShell` adapter to only handle PowerShell DSC Resources
88+
implemented as classes. The `Microsoft.Windows/WindowsPowerShell` adapter continues to work with
89+
classic PSDSC resources. Neither adapter supports composite PSDSC resources. This change
90+
simplified the code and coincided with ensuring that the `Microsoft.DSC/PowerShell` adapter works
91+
correctly on Linux and macOS as well as Windows. This change also brought performance
92+
improvements to the adapter, speeding up resource invocation and discovery.
93+
94+
<details><summary>Related work items</summary>
95+
96+
- Issues: _None_.
97+
- PRs:
98+
- [#435][#435]
99+
- [#439][#439]
100+
101+
</details>
102+
103+
### Added
104+
105+
- Added the [`--what-if` (`-w`)][p8-01] option to the [dsc config set][cmd-cset] command. When you
106+
call `dsc config set` with the `--what-if` option, DSC doesn't actually invoke the resources to
107+
enforce the desired state. Instead, it returns the expected output for the command, showing the
108+
before and after state for each resource instance.
109+
110+
The output for the `dsc config set` operation with the `--what-if` operation is the same as an
111+
[actual configuration set operation][p8-02], except that the metadata field
112+
[executionType][p8-03] is set to `WhatIf` instead of `Actual`.
113+
114+
By default, the generated output is synthetic, based on the results of the resources' `test`
115+
operation. Resources can define the [whatIf][p8-04] property in their resource manifest to
116+
participate in what-if operations, reporting more specifically how they will change the system.
117+
For example, participating resources could indicate whether an actual set operation will require
118+
a reboot or whether the current user has the correct permissions to manage that resource
119+
instance.
120+
121+
Participating resources have the [WhatIf capability][p8-05].
122+
123+
<details><summary>Related work items</summary>
124+
125+
- Issues: [#70][#70]
126+
- PRs:
127+
- [#400][#400]
128+
- [#441][#441]
129+
130+
</details>
131+
132+
- Added support for [importer resources][p8-06]. These resources resolve external sources to a
133+
nested DSC Configuration document. The resolved instances are processed as nested resource
134+
instances.
135+
136+
This required some updates to the schemas, all backwards-compatible:
137+
138+
- Added a new [resourceKind][p8-07] named `Import`.
139+
- Added the [resolve][p8-08] command to resource manifests.
140+
- Added the new [`Resolve`][p8-09] capability, returned in the output for the
141+
[dsc resource list][cmd-rlist] command when DSC discovers an importer resource.
142+
143+
<details><summary>Related work items</summary>
144+
145+
- Issues: [#429][#429]
146+
- PRs:
147+
- [#412][#412]
148+
- [#464][#464]
149+
150+
</details>
151+
152+
- Added the `Microsoft.DSC/Include` importer resource to resolve instances from an external
153+
configuration document. The resolved instances are processed as nested instances for the
154+
`Microsoft.DSC/Include` resource instance.
155+
156+
You can use this resource to write smaller configuration documents and compose them as needed.
157+
For example, you could define a security baseline and a web server configuration separately, then
158+
combine them for a given application:
159+
160+
```yaml
161+
$schema: &schema https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
162+
resources:
163+
# Group of included baseline configurations
164+
- name: Baselines
165+
type: Microsoft.DSC/Group
166+
properties:
167+
$schema: *schema
168+
resources:
169+
- name: Security Baseline
170+
type: Microsoft.DSC/Include
171+
properties:
172+
configurationFile: security_baseline.dsc.yaml
173+
parametersFile: security_baseline.parameters.yaml
174+
- name: Web Server Baseline
175+
type: Microsoft.DSC/Include
176+
properties:
177+
configurationFile: web_baseline.dsc.yaml
178+
parametersFile: web_baseline.parameters.yaml
179+
dependsOn:
180+
- "[resourceId('Microsoft.DSC/Include', 'Security Baseline')]"
181+
182+
# application configuration instances, all depend on the baselines
183+
- name: Application configuration
184+
type: MyApp/Settings
185+
properties:
186+
someSetting: someValue
187+
dependsOn:
188+
- "[resourceId('Microsoft.DSC/Group', 'Baselines')]"
189+
```
190+
191+
<details><summary>Related work items</summary>
192+
193+
- Issues: [#429][#429]
194+
- PRs: [#412][#412]
195+
196+
</details>
197+
198+
- Added caching for PowerShell Desired State Configuration (PSDSC) resources when using the
199+
`Microsoft.DSC/PowerShell` and `Microsoft.Windows/PowerShell` adapters. The adapters use the
200+
cache to speed up resource discovery. The performance improvement reduced the resource list time
201+
under tests from eight seconds to two seconds, and reduced invocation operation times by half.
202+
203+
The adapters cache the resources in the following locations, depending on your platform:
204+
205+
| Adapter | Platform | Path |
206+
| :----------------------------: | :------: | :---------------------------------------------- |
207+
| `Microsoft.DSC/PowerShell` | Linux | `$HOME/.dsc/PSAdapterCache.json` |
208+
| `Microsoft.DSC/PowerShell` | macOS | `$HOME/.dsc/PSAdapterCache.json` |
209+
| `Microsoft.DSC/PowerShell` | Windows | `%LOCALAPPDATA%\dsc\PSAdapterCache.json` |
210+
| `Microsoft.Windows/PowerShell` | Windows | `%LOCALAPPDATA%\dsc\WindowsPSAdapterCache.json` |
211+
212+
The adapters check whether the cache is stale on each run and refresh it if:
213+
214+
- The `PSModulePath` environmental variable is updated.
215+
- Any module is added or removed from the `PSModulePath`.
216+
- Any related files in a cached PSDSC resource module has been updated since the cache was
217+
written. The adapter watches the `LastWriteTime` of module files with the following extensions:
218+
`.ps1`, `.psd1`, `.psm1`, and `.mof`.
219+
220+
<details><summary>Related work items</summary>
221+
222+
- Issues: [#371][#371]
223+
- PRs: [#432][#432]
224+
225+
</details>
226+
227+
- Added the `DSC.PackageManagement/Apt` resource for managing software on systems that use the
228+
advanced package tool (APT). In this release, you can use the resource to:
229+
230+
- Install the latest version of a package.
231+
- Uninstall a package.
232+
- Get the current state of a package.
233+
- Export every installed package as a DSC resource instance.
234+
235+
<details><summary>Related work items</summary>
236+
237+
- Issues: _None_.
238+
- PRs: [#434][#434]
239+
240+
</details>
241+
242+
- Added the `Microsoft.DSC.Experimental/SystemctlService` class-based PSDSC resource. It has the
243+
`Get` and `Export` [capabilities][p8-10]. You can use it on Linux systems that manage services
244+
with SystemD and `systemctl`. In this release, it doesn't support setting services.
245+
246+
<details><summary>Related work items</summary>
247+
248+
- Issues: _None_.
249+
- PRs: [#454][#454]
250+
251+
</details>
252+
253+
### Fixed
254+
255+
- Fixed the JSON Schema for [exit codes][p8-11] in the resource manifest to support negative
256+
integers. Prior to this release, the DSC engine supported negative exit codes but the JSON Schema
257+
forbid them.
258+
259+
<details><summary>Related work items</summary>
260+
261+
- Issues: [#407][#407]
262+
- PRs: [#410][#410]
263+
264+
</details>
265+
266+
- Fixed the behavior of the [int()][int()] configuration function to error when given an input
267+
value other than a string or integer. Prior to this release, when you specified a number with
268+
a fractional part as input for the function, it coerced the input value to an integer representing
269+
the fractional part. Starting with this release, the `int()` function raises an invalid input
270+
error when the input value isn't a string or an integer.
271+
272+
<details><summary>Related work items</summary>
273+
274+
- Issues: [#390][#390]
275+
- PRs: [#438][#438]
276+
277+
</details>
278+
279+
- Fixed the implementation to retrieve non-zero exit code descriptions for resource errors from the
280+
resource manifest, if defined. Prior to this release, these error descriptions weren't surfaced.
281+
282+
<details><summary>Related work items</summary>
283+
284+
- Issues: [#431][#431]
285+
- PRs: [#444][#444]
286+
287+
</details>
288+
289+
<!-- Preview.8 links -->
290+
[p8-01]: reference/cli/config/set.md#-w---what-if
291+
[p8-02]: reference/schemas/outputs/config/set.md
292+
[p8-03]: reference/schemas/metadata/Microsoft.DSC/properties.md#executiontype
293+
[p8-04]: reference/schemas/resource/manifest/whatif.md
294+
[p8-05]: reference/schemas/outputs/resource/list.md#capability-whatif
295+
[p8-06]: reference/schemas/definitions/resourceKind.md#importer-resources
296+
[p8-07]: reference/schemas/definitions/resourceKind.md
297+
[p8-08]: reference/schemas/resource/manifest/resolve.md
298+
[p8-09]: reference/schemas/outputs/resource/list.md#capability-resolve
299+
[p8-10]: reference/schemas/outputs/resource/list.md#capabilities
300+
[p8-11]: reference/schemas/resource/manifest/root.md#exitcodes
301+
76302
## [v3.0.0-preview.7][release-v3.0.0-preview.7] - 2024-04-22
77303

78304
This section includes a summary of changes for the `preview.7` release. For the full list of changes
@@ -127,7 +353,7 @@ in this release, see the [diff on GitHub][compare-v3.0.0-preview.7].
127353

128354
</details>
129355

130-
- <a id="rename-provider-to-adapter" /> In this release, the term `DSC Resource Provider` is
356+
- <a id="rename-provider-to-adapter"></a> In this release, the term `DSC Resource Provider` is
131357
replaced with the more semantically accurate `DSC Resource Adapter`. These resources enable users
132358
to leverage resources that don't define a DSC Resource Manifest with DSC, like PSDSC resources -
133359
they're _adapters_ between DSCv3 and resources defined in a different way.
@@ -1319,6 +1545,7 @@ For the full list of changes in this release, see the [diff on GitHub][compare-v
13191545
[#362]: https://github.com/PowerShell/DSC/issues/362
13201546
[#364]: https://github.com/PowerShell/DSC/issues/364
13211547
[#368]: https://github.com/PowerShell/DSC/issues/368
1548+
[#371]: https://github.com/PowerShell/DSC/issues/371
13221549
[#373]: https://github.com/PowerShell/DSC/issues/373
13231550
[#375]: https://github.com/PowerShell/DSC/issues/375
13241551
[#376]: https://github.com/PowerShell/DSC/issues/376
@@ -1327,12 +1554,29 @@ For the full list of changes in this release, see the [diff on GitHub][compare-v
13271554
[#382]: https://github.com/PowerShell/DSC/issues/382
13281555
[#385]: https://github.com/PowerShell/DSC/issues/385
13291556
[#388]: https://github.com/PowerShell/DSC/issues/388
1557+
[#390]: https://github.com/PowerShell/DSC/issues/390
13301558
[#397]: https://github.com/PowerShell/DSC/issues/397
1559+
[#400]: https://github.com/PowerShell/DSC/issues/400
13311560
[#401]: https://github.com/PowerShell/DSC/issues/401
13321561
[#405]: https://github.com/PowerShell/DSC/issues/405
1562+
[#407]: https://github.com/PowerShell/DSC/issues/407
1563+
[#410]: https://github.com/PowerShell/DSC/issues/410
1564+
[#412]: https://github.com/PowerShell/DSC/issues/412
1565+
[#429]: https://github.com/PowerShell/DSC/issues/429
1566+
[#431]: https://github.com/PowerShell/DSC/issues/431
1567+
[#432]: https://github.com/PowerShell/DSC/issues/432
1568+
[#434]: https://github.com/PowerShell/DSC/issues/434
1569+
[#435]: https://github.com/PowerShell/DSC/issues/435
1570+
[#438]: https://github.com/PowerShell/DSC/issues/438
1571+
[#439]: https://github.com/PowerShell/DSC/issues/439
1572+
[#441]: https://github.com/PowerShell/DSC/issues/441
1573+
[#444]: https://github.com/PowerShell/DSC/issues/444
1574+
[#454]: https://github.com/PowerShell/DSC/issues/454
1575+
[#464]: https://github.com/PowerShell/DSC/issues/464
13331576
[#45]: https://github.com/PowerShell/DSC/issues/45
13341577
[#49]: https://github.com/PowerShell/DSC/issues/49
13351578
[#57]: https://github.com/PowerShell/DSC/issues/57
1579+
[#70]: https://github.com/PowerShell/DSC/issues/70
13361580
[#73]: https://github.com/PowerShell/DSC/issues/73
13371581
[#75]: https://github.com/PowerShell/DSC/issues/75
13381582
[#89]: https://github.com/PowerShell/DSC/issues/89

dsc/docs-conceptual/dsc-3.0/reference/cli/config/get.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Command line reference for the 'dsc config get' command
3-
ms.date: 05/09/2024
3+
ms.date: 06/24/2024
44
ms.topic: reference
55
title: dsc config get
66
---
@@ -52,7 +52,7 @@ document saved as `example.dsc.config.yaml`.
5252
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
5353
resources:
5454
- name: Windows only
55-
type: DSC/AssertionGroup
55+
type: Microsoft.DSC/Assertion
5656
properties:
5757
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
5858
resources:
@@ -64,9 +64,9 @@ resources:
6464
type: Microsoft.Windows/Registry
6565
properties:
6666
keyPath: HKCU\example
67-
_ensure: Present
67+
_exist: true
6868
dependsOn:
69-
- '[DSC/Assertion]Windows only'
69+
- "[resourceId('Microsoft.DSC/Assertion', 'Windows only')"
7070
```
7171
7272
```sh

dsc/docs-conceptual/dsc-3.0/reference/cli/config/set.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Command line reference for the 'dsc config set' command
3-
ms.date: 05/09/2024
3+
ms.date: 06/24/2024
44
ms.topic: reference
55
title: dsc config set
66
---
@@ -53,7 +53,7 @@ The command inspects the resource instances defined in the configuration documen
5353
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
5454
resources:
5555
- name: Windows only
56-
type: DSC/AssertionGroup
56+
type: Microsoft.DSC/Assertion
5757
properties:
5858
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
5959
resources:
@@ -65,9 +65,9 @@ resources:
6565
type: Microsoft.Windows/Registry
6666
properties:
6767
keyPath: HKCU\example
68-
_ensure: Present
68+
_exist: true
6969
dependsOn:
70-
- '[DSC/Assertion]Windows only'
70+
- "[resourceId('Microsoft.DSC/Assertion', 'Windows only')"
7171
```
7272
7373
```sh
@@ -125,6 +125,20 @@ Type: String
125125
Mandatory: false
126126
```
127127

128+
### -w, --what-if
129+
130+
When you specify this flag option, DSC doesn't actually change the system state with the `set`
131+
operation. Instead, it returns output indicating _how_ the operation will change system state when
132+
called without this option. Use this option to preview the changes DSC will make to a system.
133+
134+
The output for the command when you use this option is the same as without, except that the
135+
`ExecutionType` metadata field is set to `WhatIf` instead of `Actual`.
136+
137+
```yaml
138+
Type: Boolean
139+
Mandatory: false
140+
```
141+
128142
### -f, --format
129143

130144
The `--format` option controls the console output format for the command. If the command output is

0 commit comments

Comments
 (0)