|
| 1 | +--- |
| 2 | +description: JSON schema reference for the expected stdout from the list resource operation |
| 3 | +ms.date: 07/29/2025 |
| 4 | +ms.topic: reference |
| 5 | +title: DSC resource list operation stdout schema reference |
| 6 | +--- |
| 7 | + |
| 8 | +# DSC resource list operation stdout schema reference |
| 9 | + |
| 10 | +## Synopsis |
| 11 | + |
| 12 | +Defines the representation of an adapted resource in DSC. DSC expects every JSON Line emitted to |
| 13 | +stdout for the **List** operation to adhere to this schema. |
| 14 | + |
| 15 | +## Metadata |
| 16 | + |
| 17 | +```yaml |
| 18 | +SchemaDialect: https://json-schema.org/draft/2020-12/schema |
| 19 | +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1.0/resource/stdout/list.json |
| 20 | +Type: object |
| 21 | +``` |
| 22 | +
|
| 23 | +## Description |
| 24 | +
|
| 25 | +Defines the representation of an adapted resource in DSC. DSC expects every JSON Line emitted to |
| 26 | +stdout for the **List** operation to adhere to this schema. |
| 27 | +
|
| 28 | +DSC includes the following adapter resources: |
| 29 | +
|
| 30 | +- [Microsoft.DSC/PowerShell][01] run PowerShell and enables you to use PowerShell DSC (PSDSC) |
| 31 | +resources implemented as PowerShell classes in DSC. |
| 32 | +- [Microsoft.Windows/WindowsPowerShell][02] runs Windows PowerShell and enables you to use any |
| 33 | +available PSDSC resources in DSC. This adapter is only available when you install DSC on |
| 34 | +Windows. |
| 35 | +- [Microsoft.Windows/WMI][03] enables you to use WMI classes as resources in DSC. This adapter is |
| 36 | +only available when you install DSC on Windows. |
| 37 | +
|
| 38 | +## Required Properties |
| 39 | +
|
| 40 | +The output for the `discover` operation must include these properties: |
| 41 | + |
| 42 | +- [type](#type) |
| 43 | +- [kind](#kind) |
| 44 | +- [version](#version) |
| 45 | +- [capabilities](#capabilities) |
| 46 | +- [path](#path) |
| 47 | +- [directory](#directory) |
| 48 | +- [implementedAs](#implementedas) |
| 49 | +- [properties](#properties-1) |
| 50 | +- [requireAdapter](#requireadapter) |
| 51 | + |
| 52 | +## Properties |
| 53 | + |
| 54 | +### type |
| 55 | + |
| 56 | +The `type` property represents the fully qualified type name of the resource. It's used to specify |
| 57 | +the resource in configuration documents and as the value of the `--resource` flag when using the |
| 58 | +`dsc resource *` commands. For more information about resource type names, see |
| 59 | +[DSC Resource fully qualified type name schema reference][04]. |
| 60 | + |
| 61 | +```yaml |
| 62 | +Type: string |
| 63 | +Required: true |
| 64 | +Pattern: ^\w+(\.\w+){0,2}\/\w+$ |
| 65 | +``` |
| 66 | + |
| 67 | +### kind |
| 68 | + |
| 69 | +The `kind` property defines how DSC should handle the adapted resource. DSC supports several kinds |
| 70 | +of resources: `resource`, `group`, `adapter`, `importer`, and `exporter`. |
| 71 | + |
| 72 | +For more information, see [DSC resource kinds][05]. |
| 73 | + |
| 74 | +```yaml |
| 75 | +Type: string |
| 76 | +Required: false |
| 77 | +ValidValues: [resource, adapter, group, importer, exporter] |
| 78 | +``` |
| 79 | + |
| 80 | +### version |
| 81 | + |
| 82 | +The `version` property represents the current version of the adapted resource as a valid semantic |
| 83 | +version (semver) string. The version applies to the adapted resource, not the software it manages. |
| 84 | + |
| 85 | +```yaml |
| 86 | +Type: string |
| 87 | +Required: true |
| 88 | +Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ |
| 89 | +``` |
| 90 | + |
| 91 | +### capabilities |
| 92 | + |
| 93 | +Defines the list of capabilities for the adapted resource. DSC resources always have at least one |
| 94 | +capability. Resource capabilities define the operations you can invoke for a resource and how the |
| 95 | +resource behaves when invoked. |
| 96 | + |
| 97 | +DSC resources may have the following capabilities: |
| 98 | + |
| 99 | +- `get` - The resource can retrieve the current state of an instance. |
| 100 | +- `set` - The resource can enforce the desired state for an instance. |
| 101 | +- `setHandlesExist` - The resource handles deleting an instance during a **Set** operation. |
| 102 | +- `whatIf` - The resource can report how it would change state for an instance during a **Set** operation. |
| 103 | +- `test` - The resource implements the **Test** operation and doesn't rely on synthetic testing. |
| 104 | +- `delete` - The resource can remove an instance. |
| 105 | +- `export` - The resource can enumerate every instance. |
| 106 | +- `resolve` - The resource can resolve nested instances from an external source. |
| 107 | + |
| 108 | +For more information about resource capabilities, see [DSC resource capabilities][06]. For more |
| 109 | +information about the operations you can invoke for a resource, see [DSC resource operations][07]. |
| 110 | + |
| 111 | +```yaml |
| 112 | +Type: array |
| 113 | +Required: true |
| 114 | +ItemsMustBeUnique: true |
| 115 | +ItemsType: string |
| 116 | +ItemsValidValues: [ |
| 117 | + get, |
| 118 | + set, |
| 119 | + setHandlesExist, |
| 120 | + whatIf, |
| 121 | + test, |
| 122 | + delete, |
| 123 | + export, |
| 124 | + resolve |
| 125 | + ] |
| 126 | +``` |
| 127 | + |
| 128 | +### path |
| 129 | + |
| 130 | +Indicates the path to the adapted resource on the file system. |
| 131 | + |
| 132 | +```yaml |
| 133 | +Type: string |
| 134 | +Required: true |
| 135 | +``` |
| 136 | + |
| 137 | +### directory |
| 138 | + |
| 139 | +Indicates the path to the folder containing the adapted resource on the file system. |
| 140 | + |
| 141 | +```yaml |
| 142 | +Type: string |
| 143 | +Required: true |
| 144 | +``` |
| 145 | + |
| 146 | +### implementedAs |
| 147 | + |
| 148 | +Indicates that the adapted resource uses a custom implementation. The name can be used to |
| 149 | +distinguish between different implementations for the adapted resources. |
| 150 | + |
| 151 | +```yaml |
| 152 | +Type: string |
| 153 | +Required: true |
| 154 | +``` |
| 155 | + |
| 156 | +### author |
| 157 | + |
| 158 | +Indicates the name of the person or organization that developed and maintains the adapted Resource. |
| 159 | + |
| 160 | +```yaml |
| 161 | +Type: [string, 'null'] |
| 162 | +Required: false |
| 163 | +Pattern: ^\w+( \w+)* |
| 164 | +``` |
| 165 | + |
| 166 | +### properties |
| 167 | + |
| 168 | +Defines the adapted resource's property names. |
| 169 | + |
| 170 | +```yaml |
| 171 | +Type: array |
| 172 | +Required: false |
| 173 | +ItemsType: string |
| 174 | +ItemsPattern: ^\w+$ |
| 175 | +``` |
| 176 | + |
| 177 | +### requireAdapter |
| 178 | + |
| 179 | +Defines the fully qualified type name of the adapter that the adapted resource depends on. An |
| 180 | +adapter should always set this value to its own fully qualified resource type name. |
| 181 | + |
| 182 | +```yaml |
| 183 | +Type: string |
| 184 | +Required: true |
| 185 | +Pattern: ^\w+(\.\w+){0,2}\/\w+$ |
| 186 | +``` |
| 187 | + |
| 188 | +<!-- Reference link definitions --> |
| 189 | +[01]: ../../../resources/Microsoft/DSC/PowerShell/index.md |
| 190 | +[02]: ../../../resources/Microsoft/Windows/WindowsPowerShell/index.md |
| 191 | +[03]: ../../../resources/Microsoft/Windows/WMI/index.md |
| 192 | +[04]: ../../definitions/resourceType.md |
| 193 | +[05]: ../../../../concepts/resources/kinds.md |
| 194 | +[06]: ../../../../concepts/resources/capabilities.md |
| 195 | +[07]: ../../../../concepts/resources/operations.md |
0 commit comments