Skip to content

Commit df5b99d

Browse files
committed
escape expression
1 parent cf7d7bb commit df5b99d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dsc/tests/dsc_functions.tests.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,13 +704,14 @@ Describe 'tests for function expressions' {
704704
) {
705705
param($expression, $expectedError)
706706

707+
$escapedExpression = $expression -replace "'", "''"
707708
$config_yaml = @"
708709
`$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
709710
resources:
710711
- name: Echo
711712
type: Microsoft.DSC.Debug/Echo
712713
properties:
713-
output: "$expression"
714+
output: '$escapedExpression'
714715
"@
715716
$out = dsc -l trace config get -i $config_yaml 2>$TestDrive/error.log
716717
$LASTEXITCODE | Should -Not -Be 0

0 commit comments

Comments
 (0)