diff --git a/dsc/tests/dsc_config_get.tests.ps1 b/dsc/tests/dsc_config_get.tests.ps1 index b46a88fa..fcbf6cf6 100644 --- a/dsc/tests/dsc_config_get.tests.ps1 +++ b/dsc/tests/dsc_config_get.tests.ps1 @@ -70,10 +70,12 @@ Describe 'dsc config get tests' { $lines = Get-Content $TestDrive/ErrorStream.txt $ProgressMessagesFound = $False foreach ($line in $lines) { - $jp = $line | ConvertFrom-Json - if ($jp.activity) { # if line is a progress message - $jp.percent_complete | Should -BeIn (0..100) - $ProgressMessagesFound = $True + if ($line.StartsWith('{')) { + $jp = $line | ConvertFrom-Json + if ($jp.activity) { # if line is a progress message + $jp.percent_complete | Should -BeIn (0..100) + $ProgressMessagesFound = $True + } } } $ProgressMessagesFound | Should -BeTrue diff --git a/dsc/tests/dsc_resource_list.tests.ps1 b/dsc/tests/dsc_resource_list.tests.ps1 index 1f559a98..fcfa989d 100644 --- a/dsc/tests/dsc_resource_list.tests.ps1 +++ b/dsc/tests/dsc_resource_list.tests.ps1 @@ -64,10 +64,12 @@ Describe 'Tests for listing resources' { $lines = Get-Content $TestDrive/ErrorStream.txt $ProgressMessagesFound = $False foreach ($line in $lines) { - $jp = $line | ConvertFrom-Json - if ($jp.activity) { # if line is a progress message - $jp.percent_complete | Should -BeIn (0..100) - $ProgressMessagesFound = $True + if ($line.StartsWith('{')) { + $jp = $line | ConvertFrom-Json + if ($jp.activity) { # if line is a progress message + $jp.percent_complete | Should -BeIn (0..100) + $ProgressMessagesFound = $True + } } } $ProgressMessagesFound | Should -BeTrue