Skip to content

Conversation

SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Apr 4, 2025

PR Summary

A previous PR that cleaned up the output of Assertion to fit with get and set caused the assertion to never actually fail, just return results in the desired format.

The change here is to add a new hidden switch --as-assert so that dsc knows it's running as Assertion. Then when this is used it checks each test result and if any are NOT in desired state, it returns an error that the assertion failed. Many of the changes is just to pass this parameter to the necessary functions. A helper function is used to potentially recursively look at all the inDesiredState properties.

image

PR Context

Fix #731

Steve Lee (POWERSHELL HE/HIM) (from Dev Box) added 2 commits April 3, 2025 17:03
Steve Lee (POWERSHELL HE/HIM) (from Dev Box) added 2 commits April 3, 2025 17:22
@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Apr 4, 2025
Merged via the queue into PowerShell:main with commit a1cd9ec Apr 4, 2025
4 checks passed
@SteveL-MSFT SteveL-MSFT deleted the assert-dependson branch April 4, 2025 17:46
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.

Assertion not breaking when dependsOn is specified
2 participants