@@ -242,8 +242,11 @@ function Get-ActualState {
242
242
try {
243
243
$getResult = Invoke-DscResource - Method Get - ModuleName $cachedDscResourceInfo.ModuleName - Name $cachedDscResourceInfo.Name - Property $property
244
244
245
+ # only return DSC properties
246
+ $getResult.psobject.Properties.name | Where-Object { ' CimClass' , ' CimInstanceProperties' , ' CimSystemProperties' -notcontains $_ } | ForEach-Object - Begin { $getDscResult = @ {} } - Process { $getDscResult [$_ ] = $getResult .$_ }
247
+
245
248
# set the properties of the OUTPUT object from the result of Get-TargetResource
246
- $addToActualState.properties = $getResult
249
+ $addToActualState.properties = $getDscResult
247
250
}
248
251
catch {
249
252
$trace = @ {' Debug' = ' ERROR: ' + $_.Exception.Message } | ConvertTo-Json - Compress
@@ -293,11 +296,8 @@ function Get-ActualState {
293
296
try {
294
297
$getResult = $PSDesiredStateConfiguration.invoke ({ param ($Name , $Property ) Invoke-DscResource - Name $Name - Method Get - ModuleName @ {ModuleName = ' PSDesiredStateConfiguration' ; ModuleVersion = ' 1.1' } - Property $Property - ErrorAction Stop }, $cachedDscResourceInfo.Name , $property )
295
298
296
- $trace = @ {' Debug' = ' TEMP output: ' + $ ($getResult | ConvertTo-Json - Depth 10 - Compress) } | ConvertTo-Json - Compress
297
- $host.ui.WriteErrorLine ($trace )
298
-
299
- # only return DSC properties from the Cim instance
300
- $getresult.psobject.Properties.name | Where-Object { ' CimClass' , ' CimInstanceProperties' , ' CimSystemProperties' -notcontains $_ } | ForEach-Object - Begin { $getDscResult = @ {} } - Process { $getDscResult [$_ ] = $getResult .$_ }
299
+ # only return DSC properties
300
+ $getResult.psobject.Properties.name | Where-Object { ' CimClass' , ' CimInstanceProperties' , ' CimSystemProperties' -notcontains $_ } | ForEach-Object - Begin { $getDscResult = @ {} } - Process { $getDscResult [$_ ] = $getResult .$_ }
301
301
302
302
# set the properties of the OUTPUT object from the result of Get-TargetResource
303
303
$addToActualState.properties = $getDscResult
0 commit comments