KEMBAR78
Add `condition` support to resources within config by SteveL-MSFT · Pull Request #978 · PowerShell/DSC · GitHub
Skip to content

Conversation

@SteveL-MSFT
Copy link
Member

PR Summary

Support use of ARM's condition property for a resource where if the expression evaluates to true then the resource is used, but if false the resource is skipped.

    $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
    resources:
        - name: test
        type: Microsoft.DSC.Debug/Echo
        condition: "[equals('skip', 'yes')]"
        properties:
            output: "This should not be executed"
        - name: test2
        type: Microsoft.DSC.Debug/Echo
        condition: "[equals('no', 'no')]"
        properties:
            output: "This should be executed"

PR Context

Fix #972

Copy link
Collaborator

@tgauth tgauth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Jul 18, 2025
Merged via the queue into PowerShell:main with commit 5affd98 Jul 18, 2025
4 checks passed
@SteveL-MSFT SteveL-MSFT deleted the resource-condition branch July 18, 2025 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conditional Resource Instance Execution

2 participants