PowerShell / PowerShell/DSC

Explicitly defining PowerShell resources doesn't allow for delete

Open
#1,292 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Bug Need-Review
Dominant language
Rust
Stars
523
Forks
75
Avg merge
3d 16h
Merged PRs (30d)
24

Description

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

After the following pull request, I can create a configuration document like:

$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
- name: Basic workspace group
  type: DatabricksDsc/DatabricksAccountServicePrincipal
  properties: 
     Name: 'my-user'
     _exist: false

However, trying to execute the above throws an error: Resource 'DatabricksDsc/DatabricksAccountServicePrincipal' does not support deleteand does not handle_exist as false.

Whenever I wrap it around Microsoft.DSC/PowerShell , this doesn't happen because the adapter has the implementsPreTest set.

Steps to reproduce

Run the above configuration document

Expected behavior
The resource runs and deletes the service principal
Actual behavior
Resource 'DatabricksDsc/DatabricksAccountServicePrincipal' does not support `delete` and does not handle `_exist` as false
Error details

Environment data
Name                           Value
----                           -----
PSVersion                      7.5.4
PSEdition                      Core
GitCommitId                    7.5.4
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Version

dsc 3.2.0-preview.8

Visuals

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Microsoft.DSC/PowerShell adapter and its implementsPreTest behavior, then trace how explicitly defined PowerShell resources handle _exist: false. Reproduce the configuration document from the issue; done means the DatabricksDsc/DatabricksAccountServicePrincipal resource deletes the service principal instead of reporting that it does not support delete.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.