diff --git a/schemas/2024/04/bundled/resource/manifest.vscode.json b/schemas/2024/04/bundled/resource/manifest.vscode.json index 9af97a9a..f9fa37ed 100644 --- a/schemas/2024/04/bundled/resource/manifest.vscode.json +++ b/schemas/2024/04/bundled/resource/manifest.vscode.json @@ -638,7 +638,7 @@ "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/manifest.delete.json", "title": "Delete method", "description": "Defines how DSC must call the DSC Resource to delete an instance. Define this method for resources as an alternative to handling the `_exist` property in a `set` operation, which can lead to highly complex code. If the `set` operation for the resource is able to handle deleting an instance when `_exist` is `false`, set the `handlesExist` property of the set method definition to `true` instead.", - "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to delete an instance. Define this method for\nresources as an alternative to handling the [`_exist`][02] property in a `set` operation, which\ncan lead to highly complex code. If the `set` method for the resource is able to handle deleting\nan instance when `_exist` is `false`, set the [`handlesExist`][03] property of the set method\ndefinition to `true` instead.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#handlesExist\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to delete an instance. Define this method for\nresources as an alternative to handling the [`_exist`][02] property in a `set` operation, which\ncan lead to highly complex code. If the `set` method for the resource is able to handle deleting\nan instance when `_exist` is `false`, set the [`handlesExist`][03] property of the set method\ndefinition to `true` instead.\n\nIf you define the delete method in a resource manifest, ensure that you also define the\n[`_exist`][02] property in the [JSON schema for the resource's properties][04].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#handlesExist\n[04]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true\n", "type": "object", "required": [ "executable", diff --git a/schemas/src/resource/manifest.delete.yaml b/schemas/src/resource/manifest.delete.yaml index cf630f35..710c4930 100644 --- a/schemas/src/resource/manifest.delete.yaml +++ b/schemas/src/resource/manifest.delete.yaml @@ -21,9 +21,13 @@ markdownDescription: | # VS Code only an instance when `_exist` is `false`, set the [`handlesExist`][03] property of the set method definition to `true` instead. + If you define the delete method in a resource manifest, ensure that you also define the + [`_exist`][02] property in the [JSON schema for the resource's properties][04]. + [01]: /reference/schemas/resource/manifest/delete? [02]: /reference/schemas/resource/properties/exist? [03]: /reference/schemas/resource/manifest/set?#handlesExist + [04]: /reference/schemas/resource/manifest/schema/property? type: object required: diff --git a/schemas/src/resource/properties/exist.yaml b/schemas/src/resource/properties/exist.yaml index d254909a..7fad6b4a 100644 --- a/schemas/src/resource/properties/exist.yaml +++ b/schemas/src/resource/properties/exist.yaml @@ -16,9 +16,13 @@ markdownDescription: | [_Online Documentation_][01] *** - Indicates whether the DSC Resource instance should exist. + Indicates whether the DSC Resource instance should exist. For DSC Resources that define the + [delete method in their manifest][02], DSC calls the `delete` method for the resource when an + instance defines `_exist` as `false` and the instance exists. + [01]: /reference/schemas/resource/properties/exist? + [02]: /reference/schemas/resource/manifest/delete? markdownEnumDescriptions: - | # false _Instance shouldn't exist._