Edit

Share via


Microsoft.DSC metadata property schema reference

Synopsis

Metadata properties used and returned by DSC for configuration and resource operations.

Description

The Microsoft.DSC metadata object captures execution details that DSC adds to command output and, when applicable, to resource results. It describes what operation ran, when it started and finished, how long it took, the security context DSC ran under, and the DSC version that produced the output. These properties are informational and help with diagnostics, auditing, and tooling.

Not every property is present for every operation. For example, executionType is only meaningful for Set (and is WhatIf when you invoke DSC with --whatIf), while operation is always provided. Timestamps use RFC 3339 date-time format, and durations use the ISO 8601 duration format.

Consumers should tolerate additional, future metadata fields. Producers should preserve unknown metadata they do not interpret.

Properties

duration

Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for duration.

For example, PT0.611216S represents a duration of about 0.61 seconds.

SchemaDialect: https://json-schema.org/draft/2020-12/schema
SchemaID:      https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1.0/metadata/Microsoft.DSC/duration.json
Type:          string
Format:        duration

endDateTime

Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 (see date-time).

For example: 2024-04-14T08:49:51.395686600-07:00

SchemaDialect: https://json-schema.org/draft/2020-12/schema
SchemaID:      https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1.0/metadata/Microsoft.DSC/endDateTime.json
Type:          string
Format:        date-time

executionType

Defines whether DSC actually applied an operation to the configuration or was run in WhatIf mode. This property is always Actual for Get, Test, and Export operations. For Set operations, this value is WhatIf when DSC is invoked with the --whatIf argument.

SchemaDialect: https://json-schema.org/draft/2020-12/schema
SchemaID:      https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1.0/metadata/Microsoft.DSC/executionType.json
Type:          string
ValidValues:  [Actual, WhatIf]

operation

Defines the operation that DSC applied to the configuration document: Get, Set, Test, or Export.

SchemaDialect: https://json-schema.org/draft/2020-12/schema
SchemaID:      https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1.0/metadata/Microsoft.DSC/operation.json
Type:          string
ValidValues:  [Get, Set, Test, Export]

securityContext

Defines the security context that DSC was run under. If the value for this metadata property is Elevated, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is Restricted, DSC was run as a normal user or account in a non-elevated session.

SchemaDialect: https://json-schema.org/draft/2020-12/schema
SchemaID:      https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1.0/metadata/Microsoft.DSC/securityContext.json
Type:          string
ValidValues:  [Current, Elevated, Restricted]

startDatetime

Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 (see date-time).

For example: 2024-04-14T08:49:51.395686600-07:00

SchemaDialect: https://json-schema.org/draft/2020-12/schema
SchemaID:      https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1.0/metadata/Microsoft.DSC/startDatetime.json
Type:          string
Format:        date-time

version

Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like 3.0.0-preview.7.

SchemaDialect: https://json-schema.org/draft/2020-12/schema
SchemaID:      https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1.0/metadata/Microsoft.DSC/version.json
Type:          object