-
Notifications
You must be signed in to change notification settings - Fork 43
Integrate expressions/functions with DSC #252
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
bbcd810
add resourceId function
SteveL-MSFT 93d9f2a
connect dependsOn to new resourceId function using expressions
SteveL-MSFT 8bc08ef
change from HashMap to serde Map
SteveL-MSFT cb851f1
add expression invocation for get/set/test
SteveL-MSFT be4a40c
modify osinfo example to use concat for testing. update expression in…
SteveL-MSFT fe817d0
fix example config with expression
SteveL-MSFT 45eed27
add tracing
SteveL-MSFT 04ad821
fix invoking expressions and add dscecho resource
SteveL-MSFT c2e0426
revert change to use concat in sample config
SteveL-MSFT 9635be6
update error to provide more info
SteveL-MSFT a7d61ed
fix clippy
SteveL-MSFT 90f9264
handle ints, bools, etc..
SteveL-MSFT b41d6a5
add more details in error
SteveL-MSFT 607d2f7
fix missing parens
SteveL-MSFT 54a3880
fix so that export will escape brackets if necessary
SteveL-MSFT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
Describe 'tests for function expressions' { | ||
It 'function works: <text>' -TestCases @( | ||
@{ text = "[concat('a', 'b')]"; expected = 'ab' } | ||
@{ text = "[concat('a', 'b', 'c')]"; expected = 'abc' } | ||
@{ text = "[concat('a', 1, concat(2, 'b'))]"; expected = 'a12b' } | ||
@{ text = "[base64('ab')]"; expected = 'YWI=' } | ||
@{ text = "[base64(concat('a','b'))]"; expected = 'YWI=' } | ||
@{ text = "[base64(base64(concat('a','b')))]"; expected = 'WVdJPQ==' } | ||
) { | ||
param($text, $expected) | ||
|
||
$escapedText = $text -replace "'", "''" | ||
$config_yaml = @" | ||
`$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json | ||
resources: | ||
- name: Echo | ||
type: Test/Echo | ||
properties: | ||
text: '$escapedText' | ||
"@ | ||
$out = $config_yaml | dsc config get | ConvertFrom-Json | ||
$out.results[0].result.actualState.text | Should -Be $expected | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.