PowerShell – Get-Credential decode password?
This is what I use ( though this makes it insecure, but I think you understand that): $credential.GetNetworkCredential().password
This is what I use ( though this makes it insecure, but I think you understand that): $credential.GetNetworkCredential().password
Here you go: $password = ConvertTo-SecureString ‘P@ssw0rd’ -AsPlainText -Force $Ptr = [System.Runtime.InteropServices.Marshal]::SecureStringToCoTaskMemUnicode($password) $result = [System.Runtime.InteropServices.Marshal]::PtrToStringUni($Ptr) [System.Runtime.InteropServices.Marshal]::ZeroFreeCoTaskMemUnicode($Ptr) $result P@ssw0rd