Add CredentialManager support
It's seems many people creating their own credential management solution.
It's seems, solutions classified 2 types of approach. and there are pros/cons respectively.
- Use OS native Windows Credential Manager(by P/Invoke).
- Persist encrypted credential to file(JSON/XML) under $profile directory.
Please add standard credential management support to PowerShell.
#Example:
#Set credential to CredentialManager(password is encrypted by DPAPI)
Set-Credential -Id "Admin" -UserName "domain/Administrator" -Password "[Password]" -Persist
#Get credential from CredentialManager
$cred = Get-Credential -Id "Admin"
Also, it may be useful, existing cmdlets -Credential parameter accept string, and automatically resolved to credential by using CredentialManager.