Created
September 19, 2017 15:33
-
-
Save McShauno/a70708c77cef9df06d5703711a2ebeed to your computer and use it in GitHub Desktop.
Reads encrypted credentials from a filename.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Read-Credential($user, $fileName) | |
{ | |
$password = Get-Content $fileName | ConvertTo-SecureString | |
$credential = New-Object System.Management.Automation.PsCredential($user, $password) | |
$credential | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment