Repository navigation
Command ConvertTo DscV3ConfigurationDocument
Converts compiled pipeline resources into a DSC v3 configuration document that dsc.exe can consume.
The runner's compiled Datum output is a runner-specific shape: a list of resources with
type, name and properties, alongside pipeline-only keys such as condition,
postExecutionScript, dependsOn, parameters, conditions and variables. That shape is
consumed one resource at a time by Start-DscRunner; it is not a DSC v3 configuration
document and cannot be handed to dsc config get|test|set as-is.
ConvertTo-DscV3ConfigurationDocument produces a schema-valid DSC v3 configuration document from those resources:
- emits the document
$schemasodsc.exevalidates the payload, - keeps only the DSC v3 resource keys (
name,type,properties) and drops every pipeline-only key, since DSC v3 has no notion of them, - validates that every resource has a non-empty
name, a non-emptytype, and that thetypeis structurally a DSC v3 identifier (namespace/name); when the caller supplies the set of types reported bydsc resource list, it additionally rejects anytypethat does not actually exist on the box, - aggregates every problem and throws a single, itemized error so an operator can fix all non-compliant resources in one pass rather than fix-and-rerun.
Resource ordering is intentionally the runner's responsibility (Sort-DependsOn), so
dependsOn is not carried into the document — pass resources already in the order you want
them evaluated. Likewise, properties are emitted verbatim: expand any runner variables
(Expand-HashTable) before conversion if you want a fully-resolved document.
| Name | Type | Required | Description |
|---|---|---|---|
Resource |
Object[] |
Yes | The compiled resources to convert. Each may be a [hashtable] (as produced by ConvertFrom-Yaml / ConvertFrom-Json -AsHashtable) or a [pscustomobject], and must expose type and name; properties defaults to an empty object when absent. |
AvailableResourceType |
String[] |
No | Optional set of resource types known to the target dsc.exe (e.g. the type values from dsc resource list). When supplied, a resource whose type is not in this set is reported as non-compliant — turning the structural check into a true existence check. |
SchemaUri |
String |
No | The $schema value to stamp on the document. Defaults to the DSC v3 configuration-document schema. Override only to target a specific pinned schema version. |
$doc = ConvertTo-DscV3ConfigurationDocument -Resource $pipeline.resources
$doc | ConvertTo-Json -Depth 32 | Set-Content ./config.dsc.json -Encoding utf8
dsc config get --file ./config.dsc.json$types = (dsc resource list --output-format json | ConvertFrom-Json).type
$doc = ConvertTo-DscV3ConfigurationDocument -Resource $compiled.resources -AvailableResourceType $typesDsc.PipelineRunner 1.1.0 — generated from
the repository on 2026-09-17.
Conceptual pages are authored in WikiSource/; command pages are generated from
comment-based help. Edit those, not the wiki: the wiki is overwritten on every release.