@@ -60,7 +60,7 @@ function Add-AstMembers {
60
60
61
61
foreach ($member in $TypeAst.Members ) {
62
62
$property = $member -as [System.Management.Automation.Language.PropertyMemberAst ]
63
- if (($property -eq $null ) -or ($property.IsStatic )) {
63
+ if (($null -eq $property ) -or ($property.IsStatic )) {
64
64
continue ;
65
65
}
66
66
$skipProperty = $true
@@ -139,7 +139,7 @@ function FindAndParseResourceDefinitions {
139
139
$DscResourceInfo.Version = $moduleVersion
140
140
141
141
$DscResourceInfo.Properties = [System.Collections.Generic.List [DscResourcePropertyInfo ]]::new()
142
- $DscResourceInfo.Methods = GetClassBasedCapabilities $typeDefinitionAst.Members
142
+ $DscResourceInfo.Capabilities = GetClassBasedCapabilities $typeDefinitionAst.Members
143
143
Add-AstMembers $typeDefinitions $typeDefinitionAst $DscResourceInfo.Properties
144
144
145
145
$resourceList.Add ($DscResourceInfo )
@@ -531,21 +531,21 @@ function GetTypeInstanceFromModule {
531
531
}
532
532
533
533
function GetClassBasedCapabilities ($functionMemberAst ) {
534
- $capabilities = @ ()
534
+ $capabilities = [ System.Collections.Generic.List [ string []]]::new ()
535
535
# These are the methods that we can potentially expect in a class-based DSC resource.
536
536
$availableMethods = @ (' get' , ' set' , ' setHandlesExist' , ' whatIf' , ' test' , ' delete' , ' export' )
537
537
$methods = $functionMemberAst | Where-Object { $_ -is [System.Management.Automation.Language.FunctionMemberAst ] -and $_.Name -in $availableMethods }
538
538
539
539
foreach ($method in $methods.Name ) {
540
540
# We go through each method to properly case handle the method names.
541
541
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' ) }
549
549
}
550
550
}
551
551
@@ -601,5 +601,5 @@ class DscResourceInfo {
601
601
[string ] $ImplementedAs
602
602
[string ] $CompanyName
603
603
[System.Collections.Generic.List [DscResourcePropertyInfo ]] $Properties
604
- [string []] $Methods
604
+ [string []] $Capabilities
605
605
}
0 commit comments