Created
November 25, 2012 12:56
-
-
Save alastairs/4143393 to your computer and use it in GitHub Desktop.
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
$encryptionKey = (Get-Content "C:\EncryptionKey.txt") | |
$encryptionKey = [System.Text.Encoding]::Unicode.GetBytes($encryptionKey) | |
function Get-MyCredential { | |
$myPassword = Get-PasswordAsSecureString | |
return new-object System.Management.Automation.PSCredential "My.Username", $domainAdminPassword | |
} | |
function Get-PasswordAsSecureString { | |
return ConvertTo-SecureString -Key $encryptionKey "Place string representation of encrypted password here" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment