Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Synopsis
Indicates whether an instance should exist.
Metadata
SchemaDialect: https://json-schema.org/draft/2020-12/schema
SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1.0/resource/properties/exist.json
Type: boolean
DefaultValue: true
Description
The _exist canonical property indicates that the resource can enforce whether instances exist,
handling whether an instance should be added, updated, or removed during a set operation. This
property provides shared semantics for DSC Resources and integrating tools. Resources that define
this property indicate to DSC that they adhere to the contract for the canonical property.
Resources should only define this property when their implementation adheres to the following behavior contract:
When the desired state for
_exististrue, the resource expects the instance to exist. If it doesn't exist, the resource creates or adds the instance during the set operation.When the desired state for
_existisfalse, the resource expects the instance to not exist. If it does exist, the resource deletes or removes the instance during the set operation.When the get operation queries for an instance that doesn't exist, the returned JSON always defines the
_existproperty asfalse.The resource may omit the
_existproperty from the result JSON when the instance exists.
To add this property to a resource's instance schema, define the property with the following snippet:
"_exist": {
"$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/exist.json"
}