Created
April 8, 2016 18:16
-
-
Save kvaps/1e5888de86b995edef0a28ddd919db4e 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
# Password for Encription Certificate | |
$secret = "MyPassw0rd" | |
Get-ChildItem cert:\currentuser\my | Out-String -Width 512 | Out-File "$Env:USERPROFILE\Documents\info.txt" | |
# Copying Certificate to My Document | |
Get-ChildItem cert:\currentuser\my | | |
# Where-Object { $_.HasPrivateKey -and $_.PrivateKey.CspKeyContainerInfo.Exportable } | | |
Foreach-Object { [system.IO.file]::WriteAllBytes( "$Env:USERPROFILE\Documents\$($_.thumbprint).pfx" , ($_.Export('PFX', $secret )) ) } | |
## End of the script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment