Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate expressions/functions with DSC #252

Merged
merged 15 commits into from
Nov 7, 2023

Conversation

SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Nov 2, 2023

PR Summary

  • Removed resourceId() regex and replaced with a function
  • Add execution of expressions to get/set/test resource properties
  • This integration allows use of concat() and base64() functions within a configuration
  • Change from HashMap to serde Map for resource properties so don't need to transform from one type to the other due to nested properties
  • Expressions are evaluated only for resource properties at invocation time
  • NOTE: when converting Value to string, you have to use as_str() instead of to_string() as the latter includes outer quotes

PR Context

Partially implements #57

dsc_lib/src/configure/config_doc.rs Show resolved Hide resolved
dsc_lib/src/functions/mod.rs Show resolved Hide resolved
@SteveL-MSFT
Copy link
Member Author

The test failure is due to not handling nested types in expression invocation so fixing that.

@SteveL-MSFT
Copy link
Member Author

The remaining failure is due to properties that get returned may look like an expression so if you pipe that back to dsc, it fails. I think the right thing to do here is if it's retrieved via config, then it needs to escape it if it starts and ends with brackets.

@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Nov 7, 2023
Merged via the queue into PowerShell:main with commit 0ab0fdd Nov 7, 2023
4 checks passed
@SteveL-MSFT SteveL-MSFT deleted the resourceid-func branch November 7, 2023 16:50
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.

2 participants