Skip to content

Commit f2e2ce1

Browse files
authored
docs: Update resource schema reference (#1708)
1 parent f96b655 commit f2e2ce1

22 files changed

Lines changed: 2149 additions & 480 deletions

File tree

‎docs/reference/schemas/resource/manifest/adapter.md‎

Lines changed: 87 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: JSON schema reference for the 'adapter' property in a DSC Resource manifest
3-
ms.date: 07/03/2025
3+
ms.date: 09/01/2026
44
ms.topic: reference
55
title: DSC Resource manifest adapter property schema reference
66
---
@@ -23,7 +23,9 @@ Type: object
2323
2424
DSC Resource Adapters must define the `adapter` property in their manifest. This property
2525
identifies the resource as an adapter and defines how DSC can call the adapter to get the resources
26-
the adapter supports and how to pass resource instances to the adapter.
26+
the adapter supports and how to pass resource instances to the adapter. When a manifest defines
27+
this property and doesn't define the [kind][01] property, DSC infers the resource kind as
28+
`adapter`.
2729

2830
## Examples
2931

@@ -39,64 +41,114 @@ This example is from the `Microsoft.DSC/PowerShell` DSC Resource Adapter.
3941
"-NoLogo",
4042
"-NonInteractive",
4143
"-NoProfile",
44+
"-ExecutionPolicy",
45+
"Bypass",
4246
"-Command",
43-
"./powershell.resource.ps1 List"
47+
"./psDscAdapter/powershell.resource.ps1 List"
4448
]
45-
},
46-
"config": "full"
47-
},
49+
},
50+
"inputKind": "full"
51+
}
4852
```
4953

50-
The manifest sets `config` to `full`, indicating that the adapter expects a JSON blob representing
51-
the full and unprocessed configuration from `stdin`.
54+
The manifest sets `inputKind` to `full`, indicating that the adapter expects a JSON blob
55+
representing the full and unprocessed configuration from `stdin`.
5256

5357
It defines `list.executable` as `pwsh`. The arguments defined in `list.args` ensure that DSC runs
5458
PowerShell:
5559

5660
- Without the logo banner
5761
- In non-interactive mode
5862
- Without loading any profile scripts
59-
- To invoke the `powershell.resource.ps1` script in the same folder as the `dsc` command and
60-
pass the `List` argument.
63+
- With the execution policy set to `Bypass`
64+
- To invoke the `powershell.resource.ps1` script in the `psDscAdapter` folder next to the manifest
65+
and pass the `List` argument.
6166

6267
With this definition, DSC calls the `list` method for this adapter by running:
6368

6469
```sh
65-
pwsh -NoLogo -NonInteractive -NoProfile -Command "./powershellgroup.resource.ps1 List"
70+
pwsh -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass \
71+
-Command "./psDscAdapter/powershell.resource.ps1 List"
6672
```
6773

68-
## Required Properties
74+
### Example 2 - Microsoft.Adapter/PowerShell
75+
76+
This example is from the `Microsoft.Adapter/PowerShell` DSC Resource Adapter.
77+
78+
```json
79+
"adapter": {
80+
"list": {
81+
"executable": "pwsh",
82+
"args": [
83+
"-NoLogo",
84+
"-NonInteractive",
85+
"-NoProfile",
86+
"-ExecutionPolicy",
87+
"Bypass",
88+
"-Command",
89+
"./psDscAdapter/powershell.resource.ps1",
90+
"List",
91+
"-ResourceType",
92+
"Single"
93+
]
94+
},
95+
"inputKind": "single"
96+
}
97+
```
98+
99+
The manifest sets `inputKind` to `single`, indicating that DSC should invoke the adapter for one
100+
adapted resource instance at a time. The adapter's `get`, `set`, `test`, and `export` definitions
101+
use the [resource type argument][02] and [resource path argument][03] to identify which adapted
102+
resource to invoke.
103+
104+
## Required properties
69105

70106
The `adapter` definition must include these properties:
71107

72-
- [config](#config)
73-
- [list](#list)
108+
- [inputKind](#inputkind)
74109

75110
## Properties
76111

77-
### config
112+
### inputKind
78113

79-
The `config` property defines how the adapter expects to receive resource configurations. The
114+
The `inputKind` property defines how the adapter expects to receive resource configurations. The
80115
value must be one of the following options:
81116

82117
- `full` - Indicates that the adapter expects a JSON blob containing the full and unprocessed
83-
configuration as a single JSON blob over `stdin`.
118+
configuration as a single JSON blob over `stdin`. DSC adds a `metadata` property with the
119+
`Microsoft.DSC.context` value set to `configuration` to the input so the adapter can distinguish
120+
a full configuration from a single resource instance.
84121
- `sequence` - Indicates that the adapter expects each resource's configuration as a
85-
[JSON Line][01] over `stdin`.
122+
[JSON Line][04] over `stdin`.
123+
- `single` - Indicates that the adapter expects a single adapted resource instance. DSC invokes
124+
the adapter's operation commands directly for each adapted resource instance and passes the
125+
instance properties as the input for the command. Use the [resource type argument][02],
126+
[resource path argument][03], [resource version argument][05], and
127+
[adapted content argument][06] in the operation definitions to tell the adapter which adapted
128+
resource to invoke.
129+
130+
Prior to DSC version 3.2.0, this property was named `config`. DSC still accepts the `config` name
131+
for backward compatibility, but new manifests should use `inputKind`.
86132

87133
```yaml
88134
Type: string
89-
ValidValues: [full, sequence]
135+
Required: true
136+
ValidValues: [full, sequence, single]
90137
```
91138

92139
### list
93140

94141
The `list` property defines how to call the adapter to list the resources it supports. The value
95-
of this property must be an object and define the `executable` sub-property.
142+
of this property must be an object and define the `executable` sub-property. For more information
143+
about the expected output, see [DSC resource list operation stdout schema reference][07].
144+
145+
When this property isn't defined, DSC can't discover the adapter's resources by invoking the
146+
adapter. Users can still define adapted resources for the adapter with adapted resource manifests
147+
that specify the adapter with their `requireAdapter` property.
96148

97149
```yaml
98150
Type: object
99-
Required: true
151+
Required: false
100152
RequiredProperties: [executable]
101153
```
102154

@@ -115,12 +167,21 @@ Required: true
115167
#### args
116168

117169
The `args` sub-property defines an array of strings to pass as arguments to the command. DSC passes
118-
the arguments to the command in the order they're specified.
170+
the arguments to the command in the order they're specified. Unlike the `args` property for the
171+
operation methods, this array only accepts strings.
119172

120173
```yaml
121-
Type: array
122-
Required: false
123-
Default: []
174+
Type: array
175+
Required: false
176+
Default: []
177+
ItemsType: string
124178
```
125179

126-
[01]: https://jsonlines.org/
180+
<!-- Link reference definitions -->
181+
[01]: root.md#kind
182+
[02]: get.md#resource-type-argument
183+
[03]: get.md#resource-path-argument
184+
[04]: https://jsonlines.org/
185+
[05]: get.md#resource-version-argument
186+
[06]: get.md#adapted-content-argument
187+
[07]: ../stdout/list.md

0 commit comments

Comments
 (0)