Home > PowerShell, Tips > How to know the password captured with Get-Credential

How to know the password captured with Get-Credential

I can not right away tell you the use cases of this procedure, but felt interesting. You can know the password entered through Get-Credential cmdlet.

$mycredentials = Get-Credential
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($mycredential.Password))

I got this from http://www.roelvanlisdonk.nl/?p=1150

Happy Learning..,
Sitaram Pamarthi

Categories: PowerShell, Tips
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>