You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: adapters/powershell/psDscAdapter/psDscAdapter.psm1
+2-3Lines changed: 2 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -426,8 +426,7 @@ function Invoke-DscOperation {
426
426
# handle input objects by converting them to a hash table
427
427
$validateProperty=$cachedDscResourceInfo.Properties|Where-Object-Property Name -EQ$_.Name
428
428
if ($_.Value-is [System.Management.Automation.PSCustomObject]) {
429
-
$validateProperty=$cachedDscResourceInfo.Properties|Where-Object-Property Name -EQ$_.Name
430
-
if ($validateProperty-and$validateProperty.PropertyType-like"*PSCredential") {
429
+
if ($validateProperty-and$validateProperty.PropertyType-in@('PSCredential','System.Management.Automation.PSCredential')) {
431
430
if (-not$_.Value.Username-or-not$_.Value.Password) {
432
431
"Credential object '$($_.Name)' requires both 'username' and 'password' properties"|Write-DscTrace-Operation Error
433
432
exit1
@@ -439,7 +438,7 @@ function Invoke-DscOperation {
439
438
}
440
439
}
441
440
else {
442
-
if ($validateProperty-and$validateProperty.PropertyType-like'*SecureString'-and-not [string]::IsNullOrEmpty($_.Value)) {
441
+
if ($validateProperty-and$validateProperty.PropertyType-in@('SecureString','System.Security.SecureString')-and-not [string]::IsNullOrEmpty($_.Value)) {
0 commit comments