We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 57f71c8 commit 4af0eb4Copy full SHA for 4af0eb4
1 file changed
dsc/tests/dsc_parameters.tests.ps1
@@ -343,4 +343,16 @@ Describe 'Parameters tests' {
343
$errorMessage = Get-Content -Path $TestDrive/error.log -Raw
344
$errorMessage | Should -BeLike "*ERROR*Cannot read from STDIN for both parameters and input*"
345
}
346
+
347
+ It 'Invalid parameters read from STDIN result in error' {
348
+ $params = @{
349
+ osFamily = 'Windows'
350
+ } | ConvertTo-Json -Compress
351
352
+ $out = $params | dsc config -f - test -f "$PSScriptRoot/../examples/osinfo_parameters.dsc.yaml" 2> $TestDrive/error.log
353
+ $LASTEXITCODE | Should -Be 4
354
+ $out | Should -BeNullOrEmpty
355
+ $errorMessage = Get-Content -Path $TestDrive/error.log -Raw
356
+ $errorMessage | Should -BeLike "*ERROR*Parameter input failure: JSON: missing field ````parameters````*"
357
+ }
358
0 commit comments