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
# handle input objects by converting them to a hash table
427
+
$validateProperty=$cachedDscResourceInfo.Properties|Where-Object-Property Name -EQ$_.Name
427
428
if ($_.Value-is [System.Management.Automation.PSCustomObject]) {
428
-
$validateProperty=$cachedDscResourceInfo.Properties|Where-Object-Property Name -EQ$_.Name
429
-
if ($validateProperty-and$validateProperty.PropertyType-eq'PSCredential') {
429
+
if ($validateProperty-and$validateProperty.PropertyType-in@('PSCredential','System.Management.Automation.PSCredential')) {
430
430
if (-not$_.Value.Username-or-not$_.Value.Password) {
431
431
"Credential object '$($_.Name)' requires both 'username' and 'password' properties"|Write-DscTrace-Operation Error
432
432
exit1
@@ -438,7 +438,11 @@ function Invoke-DscOperation {
438
438
}
439
439
}
440
440
else {
441
-
$dscResourceInstance.$($_.Name) =$_.Value
441
+
if ($validateProperty-and$validateProperty.PropertyType-in@('SecureString','System.Security.SecureString') -and-not [string]::IsNullOrEmpty($_.Value)) {
0 commit comments