@@ -85,15 +85,15 @@ optional and depend on the resource.
85
85
86
86
The following list describes the available capabilities for a resource :
87
87
88
- - <a id="capability-get" / > `Get` - The resource supports retrieving the current state of an
88
+ - <a id="capability-get" ></a > `Get` - The resource supports retrieving the current state of an
89
89
instance. All DSC Resources must have this capability. A resource has this capability when it
90
90
defines the mandatory [get][07] property in its resource manifest.
91
- - <a id="capability-set" / > `Set` - The resource supports enforcing the desired state of an
91
+ - <a id="capability-set" ></a > `Set` - The resource supports enforcing the desired state of an
92
92
instance. A resource has this capability when it defines the [set][08] property in its resource
93
93
manifest. Resources without this capability can't be used with the [dsc resource set][09] or
94
94
[dsc config set][10] commands unless they're in a [Microsoft.DSC/Assertion][11] group as a nested
95
95
instance.
96
- - <a id="capability-sethandlesexist" / > `SetHandlesExist` - The resource supports the
96
+ - <a id="capability-sethandlesexist" ></a > `SetHandlesExist` - The resource supports the
97
97
[_exist property][12] directly. A resource has this capability when it defines the
98
98
[handlesExist][13] property as `true` in the definition of the [set][08] command property in its
99
99
resource manifest.
@@ -106,28 +106,43 @@ The following list describes the available capabilities for a resource:
106
106
107
107
If the resource doesn't have this capability or the `Delete` capability, DSC raises an error when
108
108
an instance defines `_exist` as `false`.
109
- - <a id="capability-test" /> `Test` - The resource supports validating the desired state of an
109
+ - <a id="capability-whatif" ></a> `WhatIf` - The resource supports returning explicit information
110
+ about how it will modify state when a user calls [dsc config set][10] with the [--what-if][15]
111
+ option. A resource has this capability when it defines the [What-if method][16] in its resource
112
+ manifest.
113
+
114
+ When a resource has this capability, DSC calls the defined command with its arguments when a
115
+ user executes the `dsc config set` command with the `--what-if` option.
116
+
117
+ When a resource doesn't have this capability, DSC synthesizes how the resource will change and
118
+ instance by converting the `Test` result for the instance into a `Set` result. The synthetic
119
+ operation can't indicate potential issues or changes that can't be determined by comparing the
120
+ result of the `Test` operation against the resource's desired state. For example, the credentials
121
+ used to test a resource might be valid for that operation, but not have permissions to actually
122
+ modify the system state. Only a resource with this capability can fully report whether and how
123
+ the resource will change system state.
124
+ - <a id="capability-test" ></a> `Test` - The resource supports validating the desired state of an
110
125
instance against the current state of the instance. A resource has this capability when it
111
- defines the [test][15 ] property in its resource manifest.
126
+ defines the [test][17 ] property in its resource manifest.
112
127
113
128
If a resource doesn't have the `Test` capability, DSC uses a synthetic test for instances of the
114
129
resource. The synthetic test compares each property for the desired state of an instance against
115
130
the actual state. The synthetic test uses strict, case-sensitive equivalence. If the desired
116
131
state for a property and the actual state aren't the same, DSC marks the property as out of the
117
132
desired state.
118
- - <a id="capability-delete" / > `Delete` - The resource supports removing an instance. A resource
133
+ - <a id="capability-delete" ></a > `Delete` - The resource supports removing an instance. A resource
119
134
has this capability when it defines the [delete][14] property in its resource manifest. This
120
135
capability isn't mutually exclusive with the `SetHandlesExist` property. A resource can handle
121
- the `_exist` property in set operations and be called directly with [dsc resource delete][16 ] to
136
+ the `_exist` property in set operations and be called directly with [dsc resource delete][18 ] to
122
137
remove an instance.
123
- - <a id="capability-export" / > `Export` - The resource supports enumerating every instance of the
124
- resource. A resource has this capability when it defines the [export][17 ] property in its resource
125
- manifest. Only resources with this capability are usable with the [dsc resource export][18] and
126
- [dsc config export][19 ] commands.
127
- - <a id="capability-resolve" / > `Resolve` - The resource supports resolving nested resource
138
+ - <a id="capability-export" ></a > `Export` - The resource supports enumerating every instance of
139
+ the resource. A resource has this capability when it defines the [export][19 ] property in its
140
+ resource manifest. Only resources with this capability are usable with the
141
+ [dsc resource export][20] and [dsc config export][21 ] commands.
142
+ - <a id="capability-resolve" ></a > `Resolve` - The resource supports resolving nested resource
128
143
instances from an external source. A resource has this capability when it defines the
129
- [resolve][20 ] property in its resource manifest. This functionality is primarily used by
130
- [importer resources][21 ].
144
+ [resolve][22 ] property in its resource manifest. This functionality is primarily used by
145
+ [importer resources][23 ].
131
146
132
147
` ` ` yaml
133
148
Type: array
@@ -215,7 +230,7 @@ Required: true
215
230
216
231
Represents the values defined in the resource's manifest. This value is `null` for resources that
217
232
aren't command-based. For more information on the value for this property, see
218
- [Command-based DSC Resource manifest schema reference][22 ].
233
+ [Command-based DSC Resource manifest schema reference][24 ].
219
234
220
235
` ` ` yaml
221
236
Type: [object, 'null']
@@ -237,11 +252,13 @@ Required: true
237
252
[12] : ../../resource/properties/exist.md
238
253
[13] : ../../resource/manifest/set.md#handlesexist
239
254
[14] : ../../resource/manifest/delete.md
240
- [15] : ../../resource/manifest/test.md
241
- [16] : ../../../cli/resource/delete.md
242
- [17] : ../../resource/manifest/export.md
243
- [18] : ../../../cli/resource/export.md
244
- [19] : ../../../cli/config/export.md
245
- [20] : ../../resource/manifest/resolve.md
246
- [21] : ../../definitions/resourceKind.md#importer-resources
247
- [22] : ../../resource/manifest/root.md
255
+ [15] : ../../../cli/config/set.md#-w---what-if
256
+ [16] : ../../resource/manifest/whatif.md
257
+ [17] : ../../resource/manifest/test.md
258
+ [18] : ../../../cli/resource/delete.md
259
+ [19] : ../../resource/manifest/export.md
260
+ [20] : ../../../cli/resource/export.md
261
+ [21] : ../../../cli/config/export.md
262
+ [22] : ../../resource/manifest/resolve.md
263
+ [23] : ../../definitions/resourceKind.md#importer-resources
264
+ [24] : ../../resource/manifest/root.md
0 commit comments