Skip to content

Instantly share code, notes, and snippets.

@h3nryza
Created July 17, 2018 17:42
Show Gist options
  • Select an option

  • Save h3nryza/ae67c7d669b4845e1b419fe568c7db29 to your computer and use it in GitHub Desktop.

Select an option

Save h3nryza/ae67c7d669b4845e1b419fe568c7db29 to your computer and use it in GitHub Desktop.
Powershell "secret" password convertion - Unsafe
(Get-Credential).Password |ConvertFrom-SecureString | out-file "C:\Automation\secret.txt"
$pwd = Get-Content "C:\Automation\secret.txt" | ConvertTo-SecureString
$mycreds = New-Object System.Management.Automation.PSCredential (“username”, $pwd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment