PowerShell / PowerShell/DSC

Assertion section in config doc

Open
#1,421 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Enhancement Partner-WinGet
Dominant language
Rust
Stars
523
Forks
75
Avg merge
3d 16h
Merged PRs (30d)
24

Description

Summary of the new feature / enhancement

Admins may want to blast out configurations and have it only apply if the config is applicable via assertions. Having it as a dedicated section in the config makes it easy to understand what is being tested and you don't have to declare dependsOn for it as it would always be run first. In this case, if any assertion fails it would stop deployment immediately. One question is whether we need to assert(false) instead of always assuming assert(true).

Proposed technical implementation details (optional)
# assertions would always be processed first
# all asserts must be true otherwise an error is returned
# collect and return all assertions and don't fail on first false
assertions:
  resources:
    - type: Microsoft/OSInfo
      properties:
        family: Windows
    - type: Foo/Bar
      properties:
        hello: world
resources:
  - type: Microsoft.Windows/Registry
    properties:
      keyPath: HKCU/Environment
      _exist: true

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

The issue names no files, tests, or entry points. Start by locating the configuration schema/parser and deployment validation flow, then determine how assertion resources should be represented and evaluated. Done means assertions run before resources, all failures are reported, and deployment stops when any assertion fails.

Written by the indexing model from the issue text.

Assessment

Tech stack
yaml
Domain
devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.