File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ testAst is CommandAst cmdAst &&
107107 // Check for -TypeName parameter
108108 if (
109109 bindingResult . BoundParameters . ContainsKey ( "TypeName" ) &&
110- bindingResult . BoundParameters [ "TypeName" ] != null &&
110+ bindingResult . BoundParameters [ "TypeName" ] . ConstantValue != null &&
111111 arrayListName . IsMatch ( bindingResult . BoundParameters [ "TypeName" ] . ConstantValue as string )
112112 )
113113 {
Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ Describe "AvoidArrayList" {
266266 It " Dynamic types shouldn't error" {
267267 $scriptDefinition = {
268268 $type = " System.Collections.ArrayList"
269- New-Object - TypeName ' $type'
269+ New-Object - TypeName $type
270270 }.ToString()
271271
272272 $analyzer = { Invoke-ScriptAnalyzer - ScriptDefinition $scriptDefinition - IncludeRule @ ($ruleName ) }
You can’t perform that action at this time.
0 commit comments