To show the password from the Get-Credentials cmdlet in plaintext,  use the following PowerShell script:


$credential = Get-Credential

[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($credential .Password))

2 Replies to “Show password in plaintext, by using Get-Credential in PowerShell”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts