File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -317,6 +317,26 @@ Describe "Test Severity" {
317317 $errors = Invoke-ScriptAnalyzer $directory \TestScript.ps1 - Severity information, warning
318318 $errors.Count | Should Be 1
319319 }
320+
321+ It " works for dsc rules" {
322+ $testDataPath = [System.IO.Path ]::Combine($ (Split-Path $directory - Parent), `
323+ ' Rules' , `
324+ ' DSCResources' , `
325+ ' MSFT_WaitForAll' , `
326+ ' MSFT_WaitForAll.psm1' )
327+
328+ Function Get-Count {begin {$count = 0 } process {$count ++ } end {$count }}
329+
330+ Invoke-ScriptAnalyzer - Path $testDataPath - Severity Error | `
331+ Where-Object {$_.RuleName -eq " PSDSCUseVerboseMessageInDSCResource" } | `
332+ Get-Count | `
333+ Should Be 0
334+
335+ Invoke-ScriptAnalyzer - Path $testDataPath - Severity Information | `
336+ Where-Object {$_.RuleName -eq " PSDSCUseVerboseMessageInDSCResource" } | `
337+ Get-Count | `
338+ Should Be 2
339+ }
320340 }
321341
322342 Context " When used incorrectly" {
You can’t perform that action at this time.
0 commit comments