Skip to content

Instantly share code, notes, and snippets.

@xabim
Created June 5, 2018 14:51
Show Gist options
  • Save xabim/61bc5319237400371b53a3e425121d6a to your computer and use it in GitHub Desktop.
Save xabim/61bc5319237400371b53a3e425121d6a to your computer and use it in GitHub Desktop.
Encrypt a plain text with certificate in powershell with CMS
$Cert = Get-ChildItem Cert:\LocalMachine\My | Where-Object {$_.Subject -like "CN=Script Automa*"}
$Password = 'Password'
Protect-CmsMessage -To $Cert -Content $Password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment