Skip to content

Commit 55b152f

Browse files
author
Andrew
committed
Updated PS adapter
1 parent 9e7109a commit 55b152f

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

powershell-adapter/psDscAdapter/psDscAdapter.psm1

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -408,11 +408,8 @@ function Invoke-DscOperation {
408408
$psVersion = $PSVersionTable.PSVersion.ToString()
409409
'PowerShell version: ' + $psVersion | Write-DscTrace
410410

411-
$moduleVersion = Get-Module PSDesiredStateConfiguration | ForEach-Object Version
412-
'PSDesiredStateConfiguration module version: ' + $moduleVersion | Write-DscTrace
413-
414411
# get details from cache about the DSC resource, if it exists
415-
$cachedDscResourceInfo = $dscResourceCache | Where-Object Type -EQ $DesiredState.adapted_dsc_type | ForEach-Object DscResourceInfo
412+
$cachedDscResourceInfo = $dscResourceCache | Where-Object Type -EQ $DesiredState.type | ForEach-Object DscResourceInfo
416413

417414
# if the resource is found in the cache, get the actual state
418415
if ($cachedDscResourceInfo) {
@@ -477,7 +474,7 @@ function Invoke-DscOperation {
477474
}
478475
else {
479476
$dsJSON = $DesiredState | ConvertTo-Json -Depth 10
480-
$errmsg = 'Can not find type "' + $DesiredState.adapted_dsc_type + '" for resource "' + $dsJSON + '". Please ensure that Get-DscResource returns this resource type.'
477+
$errmsg = 'Can not find type "' + $DesiredState.type + '" for resource "' + $dsJSON + '". Please ensure that Get-DscResource returns this resource type.'
481478
'ERROR: ' + $errmsg | Write-DscTrace
482479
exit 1
483480
}

powershell-adapter/psDscAdapter/win_psDscAdapter.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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.adapted_dsc_type | ForEach-Object DscResourceInfo
312+
$cachedDscResourceInfo = $dscResourceCache | Where-Object Type -EQ $DesiredState.type | ForEach-Object DscResourceInfo
313313

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

0 commit comments

Comments
 (0)