diff --git a/Powershell/MCRA.Tools/Command-Credential.ps1 b/Powershell/MCRA.Tools/Command-Credential.ps1 index d495aa7e175c2225512873320b09f44e4957bc39..32c297c1988d2ab8170cbe5ccfdac3345a7afbe9 100644 --- a/Powershell/MCRA.Tools/Command-Credential.ps1 +++ b/Powershell/MCRA.Tools/Command-Credential.ps1 @@ -768,8 +768,11 @@ Doorloopt een tekstdialoog waarin de naam van de credential, de username en pass } if ( $PSCmdlet.ParameterSetName -eq 'Credential' ) { - $UserName=$Credential.UserName - $Password=$Credential.GetNetworkCredential().Password + if ( $Secure ) { + $Password=ConvertFrom-SecureString -SecureString $Credential.Password + } else { + $Password=$Credential.GetNetworkCredential().Password + } } else { if ( $Secure ) { $Password=ConvertFrom-SecureString -SecureString (ConvertTo-SecureString $Password -AsPlainText -Force)