microsoft / DSCEA

DSC Environment Analyzer (DSCEA) is a simple implementation of PowerShell Desired State Configuration that uses the declarative nature of DSC to scan systems in an environment against a defined reference MOF file and generate compliance reports as to whether systems match the desired configuration.
https://microsoft.github.io/DSCEA
Other
197 stars 41 forks source link

Error when you testing an incompatible server #58

Closed ThierryBT closed 7 years ago

ThierryBT commented 7 years ago

Hi Ralph and Keith and sorry for my Funny English. When you check compliance, if all servers are not compatibles with Powershell version (see #57, New Powershell Check Version), you have an error message.

dscea2

Do you think it's possible to replace line 364 : Write-Progress -activity "Working..." -PercentComplete (($jobscomplete / $jobs.count)*100) -status "$([string]::Format("Time Elapsed: {0:d2}:{1:d2}:{2:d2} Jobs Complete: {3} of {4} ", $elapsedTime.Elapsed.hours, $elapsedTime.Elapsed.minutes, $elapsedTime.Elapsed.seconds, $jobscomplete, $jobs.count))";

by

switch ($jobs.count) {{$jobs.count -eq 0}{Write-host "Nothing to test ...";break} {$jobs.count -ne 0}{Write-Progress -activity "Working..." -PercentComplete (($jobscomplete / $jobs.count)*100) -status "$([string]::Format("Time Elapsed: {0:d2}:{1:d2}:{2:d2} Jobs Complete: {3} of {4} ", $elapsedTime.Elapsed.hours, $elapsedTime.Elapsed.minutes, $elapsedTime.Elapsed.seconds, $jobscomplete, $jobs.count))"}}

dscea3

Regards Thierry

rkyttle commented 7 years ago

Closing this issue, this will be resolved by implementing deeper checking to ensure that systems being scanned aren't just at WMF 5 or higher, but at the RTM version of WMF 5 or higher.