File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
adapters/powershell/psDscAdapter Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -427,7 +427,11 @@ function Invoke-DscOperation {
427427 " Credential object '$ ( $_.Name ) ' requires both 'username' and 'password' properties" | Write-DscTrace - Operation Error
428428 exit 1
429429 }
430- $dscResourceInstance .$ ($_.Name ) = [System.Management.Automation.PSCredential ]::new($_.Value.Username , (ConvertTo-SecureString - AsPlainText $_.Value.Password - Force))
430+
431+ $username = $_.Value.secureObject.username
432+ $password = $_.Value.secureObject.password | ConvertTo-SecureString - AsPlainText - Force
433+
434+ $dscResourceInstance .$ ($_.Name ) = [System.Management.Automation.PSCredential ]::new($username , $password )
431435 } else {
432436 $dscResourceInstance .$ ($_.Name ) = $_.Value.psobject.properties | ForEach-Object - Begin { $propertyHash = @ {} } - Process { $propertyHash [$_.Name ] = $_.Value } - End { $propertyHash }
433437 }
You can’t perform that action at this time.
0 commit comments