Skip to content

Commit 371aac8

Browse files
author
Andrew
committed
Updated PS and WMI adapters
1 parent cc5687a commit 371aac8

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

powershell-adapter/psDscAdapter/psDscAdapter.psm1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,8 @@ function Get-DscResourceObject {
379379
}
380380
else {
381381
# mimic a config object with a single resource
382-
$type = $inputObj.type
383-
$inputObj.psobject.properties.Remove('type')
382+
$type = $inputObj.adapted_dsc_type
383+
$inputObj.psobject.properties.Remove('adapted_dsc_type')
384384
$desiredState += [dscResourceObject]@{
385385
name = $adapterName
386386
type = $type
@@ -412,7 +412,7 @@ function Invoke-DscOperation {
412412
'PSDesiredStateConfiguration module version: ' + $moduleVersion | Write-DscTrace
413413

414414
# get details from cache about the DSC resource, if it exists
415-
$cachedDscResourceInfo = $dscResourceCache | Where-Object Type -EQ $DesiredState.type | ForEach-Object DscResourceInfo
415+
$cachedDscResourceInfo = $dscResourceCache | Where-Object Type -EQ $DesiredState.adapted_dsc_type | ForEach-Object DscResourceInfo
416416

417417
# if the resource is found in the cache, get the actual state
418418
if ($cachedDscResourceInfo) {
@@ -477,7 +477,7 @@ function Invoke-DscOperation {
477477
}
478478
else {
479479
$dsJSON = $DesiredState | ConvertTo-Json -Depth 10
480-
$errmsg = 'Can not find type "' + $DesiredState.type + '" for resource "' + $dsJSON + '". Please ensure that Get-DscResource returns this resource type.'
480+
$errmsg = 'Can not find type "' + $DesiredState.adapted_dsc_type + '" for resource "' + $dsJSON + '". Please ensure that Get-DscResource returns this resource type.'
481481
'ERROR: ' + $errmsg | Write-DscTrace
482482
exit 1
483483
}

powershell-adapter/psDscAdapter/win_psDscAdapter.psm1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ function Get-DscResourceObject {
276276
}
277277
else {
278278
# mimic a config object with a single resource
279-
$type = $inputObj.type
280-
$inputObj.psobject.properties.Remove('type')
279+
$type = $inputObj.adapted_dsc_type
280+
$inputObj.psobject.properties.Remove('adapted_dsc_type')
281281
$desiredState += [dscResourceObject]@{
282282
name = $adapterName
283283
type = $type
@@ -309,7 +309,7 @@ function Invoke-DscOperation {
309309
'PSDesiredStateConfiguration module version: ' + $moduleVersion | Write-DscTrace
310310

311311
# get details from cache about the DSC resource, if it exists
312-
$cachedDscResourceInfo = $dscResourceCache | Where-Object Type -EQ $DesiredState.type | ForEach-Object DscResourceInfo
312+
$cachedDscResourceInfo = $dscResourceCache | Where-Object Type -EQ $DesiredState.adapted_dsc_type | ForEach-Object DscResourceInfo
313313

314314
# if the resource is found in the cache, get the actual state
315315
if ($cachedDscResourceInfo) {
@@ -453,7 +453,7 @@ function Invoke-DscOperation {
453453
}
454454
else {
455455
$dsJSON = $DesiredState | ConvertTo-Json -Depth 10
456-
$errmsg = 'Can not find type "' + $DesiredState.type + '" for resource "' + $dsJSON + '". Please ensure that Get-DscResource returns this resource type.'
456+
$errmsg = 'Can not find type "' + $DesiredState.adapted_dsc_type + '" for resource "' + $dsJSON + '". Please ensure that Get-DscResource returns this resource type.'
457457
'ERROR: ' + $errmsg | Write-DscTrace
458458
exit 1
459459
}

wmi-adapter/wmi.resource.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ elseif ($Operation -eq 'Get')
105105
}
106106
else # we are processing an individual resource call
107107
{
108-
$type_fields = $inputobj_pscustomobj.type -split "/"
108+
$type_fields = $inputobj_pscustomobj.adapted_dsc_type -split "/"
109109
$wmi_namespace = $type_fields[0].Replace('.','\')
110110
$wmi_classname = $type_fields[1]
111111

0 commit comments

Comments
 (0)