Skip to content

Commit d66588c

Browse files
committed
Filter properly on class name
1 parent 5eda4f7 commit d66588c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

powershell-adapter/psDscAdapter/win_psDscAdapter.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ function GetClassBasedCapabilities {
669669
$availableMethods = @('get', 'set', 'setHandlesExist', 'whatIf', 'test', 'delete', 'export')
670670
foreach ($typeDefinitionAst in $typeDefinitions) {
671671
foreach ($a in $typeDefinitionAst.Attributes) {
672-
if ($a.TypeName.Name -eq 'DscResource') {
672+
if ($a.TypeName.Name -eq 'DscResource' -and $a.Parent.Name -eq $className) {
673673
$methods = $typeDefinitionAst.Members | Where-Object { $_ -is [System.Management.Automation.Language.FunctionMemberAst] -and $_.Name -in $availableMethods }
674674

675675
foreach ($method in $methods.Name) {

0 commit comments

Comments
 (0)