@@ -364,16 +364,16 @@ function Invoke-DscOperation {
364
364
# morph the INPUT object into a hashtable named "property" for the cmdlet Invoke-DscResource
365
365
$DesiredState.properties.psobject.properties | ForEach-Object - Begin { $property = @ {} } - Process {
366
366
if ($_.Value -is [System.Management.Automation.PSCustomObject ]) {
367
- $validateProperty = $cachedDscResourceInfo.Properties | Where-Object - Property Name -EQ $_.Value
367
+ $validateProperty = $cachedDscResourceInfo.Properties | Where-Object - Property Name -EQ $_.Name
368
368
if ($validateProperty.PropertyType -eq ' PSCredential' ) {
369
369
if (-not $_.Value.Username -and -not $_.Value.Password ) {
370
370
" Credential property '$ ( $_.Name ) ' requires both username and password input object" | Write-DscTrace - Operation Error
371
371
exit 1
372
372
}
373
- $dscResourceInstance .$ ($_.Name ) = [System.Management.Automation.PSCredential ]::new($_.Value.Username , (ConvertTo-SecureString - AsPlainText $_.Value.Password - Force))
373
+ $property .$ ($_.Name ) = [System.Management.Automation.PSCredential ]::new($_.Value.Username , (ConvertTo-SecureString - AsPlainText $_.Value.Password - Force))
374
374
}
375
375
else {
376
- $dscResourceInstance .$ ($_.Name ) = $_.Value.psobject.properties | ForEach-Object - Begin { $propertyHash = @ {} } - Process { $propertyHash [$_.Name ] = $_.Value } - End { $propertyHash }
376
+ $property .$ ($_.Name ) = $_.Value.psobject.properties | ForEach-Object - Begin { $propertyHash = @ {} } - Process { $propertyHash [$_.Name ] = $_.Value } - End { $propertyHash }
377
377
}
378
378
}
379
379
else {
@@ -414,7 +414,7 @@ function Invoke-DscOperation {
414
414
$DesiredState.properties.psobject.properties | ForEach-Object - Process {
415
415
# handle input objects by converting them to a hash table
416
416
if ($_.Value -is [System.Management.Automation.PSCustomObject ]) {
417
- $validateProperty = $cachedDscResourceInfo.Properties | Where-Object - Property Name -EQ $_.Value
417
+ $validateProperty = $cachedDscResourceInfo.Properties | Where-Object - Property Name -EQ $_.Name
418
418
if ($validateProperty.PropertyType -eq ' PSCredential' ) {
419
419
if (-not $_.Value.Username -and -not $_.Value.Password ) {
420
420
" Credential property '$ ( $_.Name ) ' requires both username and password input object" | Write-DscTrace - Operation Error
@@ -472,16 +472,16 @@ function Invoke-DscOperation {
472
472
# morph the INPUT object into a hashtable named "property" for the cmdlet Invoke-DscResource
473
473
$DesiredState.properties.psobject.properties | ForEach-Object - Begin { $property = @ {} } - Process {
474
474
if ($_.Value -is [System.Management.Automation.PSCustomObject ]) {
475
- $validateProperty = $cachedDscResourceInfo.Properties | Where-Object - Property Name -EQ $_.Value
475
+ $validateProperty = $cachedDscResourceInfo.Properties | Where-Object - Property Name -EQ $_.Name
476
476
if ($validateProperty.PropertyType -eq ' PSCredential' ) {
477
477
if (-not $_.Value.Username -and -not $_.Value.Password ) {
478
478
" Credential property '$ ( $_.Name ) ' requires both username and password input object" | Write-DscTrace - Operation Error
479
479
exit 1
480
480
}
481
- $dscResourceInstance .$ ($_.Name ) = [System.Management.Automation.PSCredential ]::new($_.Value.Username , (ConvertTo-SecureString - AsPlainText $_.Value.Password - Force))
481
+ $property .$ ($_.Name ) = [System.Management.Automation.PSCredential ]::new($_.Value.Username , (ConvertTo-SecureString - AsPlainText $_.Value.Password - Force))
482
482
}
483
483
else {
484
- $dscResourceInstance .$ ($_.Name ) = $_.Value.psobject.properties | ForEach-Object - Begin { $propertyHash = @ {} } - Process { $propertyHash [$_.Name ] = $_.Value } - End { $propertyHash }
484
+ $property .$ ($_.Name ) = $_.Value.psobject.properties | ForEach-Object - Begin { $propertyHash = @ {} } - Process { $propertyHash [$_.Name ] = $_.Value } - End { $propertyHash }
485
485
}
486
486
}
487
487
else {
0 commit comments