Skip to content

Commit 8a02083

Browse files
author
Kapil Borle
committed
Add a test case to PSAvoidUsingCmdletAliases rule
1 parent 6129888 commit 8a02083

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Tests/Rules/AvoidUsingAlias.tests.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,22 @@ gci -Path C:\
4040
It "returns no violations" {
4141
$noViolations.Count | Should Be 0
4242
}
43+
44+
It "should return no violation for assignment statement-like command in dsc configuration" {
45+
$target = @'
46+
Configuration MyDscConfiguration {
47+
Node "NodeA" {
48+
SomeResource MyResourceInstance {
49+
Type = "Present"
50+
Name = "RSAT"
51+
}
52+
}
53+
}
54+
'@
55+
Invoke-ScriptAnalyzer -ScriptDefinition $target -IncludeRule $violationName | `
56+
Get-Count | `
57+
Should Be 0
58+
}
4359
}
4460

4561
Context "Settings file provides whitelist" {

0 commit comments

Comments
 (0)