diff --git a/powershell-adapter/psDscAdapter/psDscAdapter.psm1 b/powershell-adapter/psDscAdapter/psDscAdapter.psm1 index 170d9450..2aad54cc 100644 --- a/powershell-adapter/psDscAdapter/psDscAdapter.psm1 +++ b/powershell-adapter/psDscAdapter/psDscAdapter.psm1 @@ -484,11 +484,12 @@ function Invoke-DscOperation { $addToActualState.properties = [psobject]@{'InDesiredState'=$Result} } 'Export' { + $t = $dscResourceInstance.GetType() $methods = $t.GetMethods() | Where-Object { $_.Name -eq 'Export' } - $method = foreach ($m in $methods) { - if ($m.GetParameters().Count -eq 0) { - $m - break + $method = foreach ($mt in $methods) { + if ($mt.GetParameters().Count -eq 0) { + $mt + break } }