Repo archived because secure string shouldn't be used anymore :)
See https://github.com/dotnet/platform-compat/blob/master/docs/DE0001.md
Secure encrpytion and decryption of credentials in PowerShell.
Module and script for secure encrpytion and decryption of credentials in PowerShell. Encrypted credentials can be stored in an xml-file or variable and be decrypted from there.
This function uses the SecureString Class from the .NET-Framework. Once encrypted credentials, can only be decrypted by the same user and on the same computer.
If user "A" encrypt the credentials on computer "A", user "B" cannot decrypt the credentials on computer "A" and also user "A" cannot decrypt the credentials on Computer "B".
- Download the latest Release
- Copy the folder Module\ManagedCredential to
C:\Users\%username%\Documents\WindowsPowerShell\Modules\
- Open up a PowerShell as an admin and set the execution policy:
Set-ExecutionPolicy RemoteSigned
- Import the Module with the command
Import-Module ManagedCredential
(Maybe add this command to your PowerShell profile)
Function | Description | Help |
---|---|---|
New-ManagedCredential | Secure encryption of credentials as SecureString | 📖 |
Get-ManagedCredential | Secure decryption of encrypted credentials | 📖 |
Function | Description | Help |
---|---|---|
New-ManagedCredential.ps1 | Secure encryption of credentials as SecureString | 📖 |
Get-ManagedCredential.ps1 | Secure decryption of encrypted credentials | 📖 |