DSC icon indicating copy to clipboard operation
DSC copied to clipboard

Calling `set` with `_exist` is `false` does not run `delete`

Open ThomasNieto opened this issue 1 month ago • 0 comments

Prerequisites

  • [x] Write a descriptive title.
  • [x] Make sure you are able to repro it on the latest version
  • [x] Search the existing issues.

Summary

Resources that support both set and delete does not call the correct operation when _exist is set to false.

I know if I were to create a config doc it would be called correctly but with rapid testing, I just change the payload from creating to deleting by setting the _exist property instead of changing the set to delete.

Steps to reproduce

  1. Create resource with set and delete operations and _exist canonical property.
  2. Call dsc resource set with (@{ _exist = $false} | ConvertTo-Json)

Expected behavior

The resource is deleted

Actual behavior

The resource is not deleted

Error details


Environment data

7.6.0-preview.5

Version

dsc 3.2.0-preview.8

Visuals

No response

ThomasNieto avatar Nov 18 '25 05:11 ThomasNieto