Edit

Share via


DSC Resource _purge property schema

Synopsis

Indicates that the resource should treat non-defined entries in a list as invalid.

Metadata

SchemaDialect: https://json-schema.org/draft/2020-12/schema
SchemaID:      https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/properties/purge.json
Type:          [boolean, 'null']
WriteOnly:     true

Description

DSC Resources that need to distinguish between whether unmanaged entries in a list are valid or must be removed can define the _purge property.

When a resource's instance schema defines this property, it indicates that the resource changes its behavior based on the property's value in an instance's desired state:

  • When _purge is true, the resource removes unmanaged entries. The resource treats any entries not listed in the instance's desired state as invalid.
  • When _purge is false or not specified, the resource ignores unmanaged entries.

When a resource defines this property, it should always document which property or properties _purge affects. A resource can define _purge as a subproperty for a complex property.

This property is write-only. A resource that uses the _purge property should never return _purge in the instance's output state. A resource must not define _purge as a mandatory property.

To add this property to a resource's instance schema, define the property with the following snippet:

"_inDesiredState": {
  "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/properties/purge.json"
}