@@ -60,7 +60,7 @@ function Add-AstMembers {
6060
6161 foreach ($member in $TypeAst.Members ) {
6262 $property = $member -as [System.Management.Automation.Language.PropertyMemberAst ]
63- if (($property -eq $null ) -or ($property.IsStatic )) {
63+ if (($null -eq $property ) -or ($property.IsStatic )) {
6464 continue ;
6565 }
6666 $skipProperty = $true
@@ -139,7 +139,7 @@ function FindAndParseResourceDefinitions {
139139 $DscResourceInfo.Version = $moduleVersion
140140
141141 $DscResourceInfo.Properties = [System.Collections.Generic.List [DscResourcePropertyInfo ]]::new()
142- $DscResourceInfo.Methods = GetClassBasedCapabilities $typeDefinitionAst.Members
142+ $DscResourceInfo.Capabilities = GetClassBasedCapabilities $typeDefinitionAst.Members
143143 Add-AstMembers $typeDefinitions $typeDefinitionAst $DscResourceInfo.Properties
144144
145145 $resourceList.Add ($DscResourceInfo )
@@ -531,21 +531,21 @@ function GetTypeInstanceFromModule {
531531}
532532
533533function GetClassBasedCapabilities ($functionMemberAst ) {
534- $capabilities = @ ()
534+ $capabilities = [ System.Collections.Generic.List [ string []]]::new ()
535535 # These are the methods that we can potentially expect in a class-based DSC resource.
536536 $availableMethods = @ (' get' , ' set' , ' setHandlesExist' , ' whatIf' , ' test' , ' delete' , ' export' )
537537 $methods = $functionMemberAst | Where-Object { $_ -is [System.Management.Automation.Language.FunctionMemberAst ] -and $_.Name -in $availableMethods }
538538
539539 foreach ($method in $methods.Name ) {
540540 # We go through each method to properly case handle the method names.
541541 switch ($method ) {
542- ' Get' { $capabilities += ' get' }
543- ' Set' { $capabilities += ' set' }
544- ' Test' { $capabilities += ' test' }
545- ' WhatIf' { $capabilities += ' whatIf' }
546- ' SetHandlesExist' { $capabilities += ' setHandlesExist' }
547- ' Delete' { $capabilities += ' delete' }
548- ' Export' { $capabilities += ' export' }
542+ ' Get' { $capabilities.Add ( ' get' ) }
543+ ' Set' { $capabilities.Add ( ' set' ) }
544+ ' Test' { $capabilities.Add ( ' test' ) }
545+ ' WhatIf' { $capabilities.Add ( ' whatIf' ) }
546+ ' SetHandlesExist' { $capabilities.Add ( ' setHandlesExist' ) }
547+ ' Delete' { $capabilities.Add ( ' delete' ) }
548+ ' Export' { $capabilities.Add ( ' export' ) }
549549 }
550550 }
551551
@@ -601,5 +601,5 @@ class DscResourceInfo {
601601 [string ] $ImplementedAs
602602 [string ] $CompanyName
603603 [System.Collections.Generic.List [DscResourcePropertyInfo ]] $Properties
604- [string []] $Methods
604+ [string []] $Capabilities
605605}
0 commit comments