Last active
September 22, 2022 18:06
-
-
Save ChrFrohn/e39657f9692fcbac46fa0d1968402898 to your computer and use it in GitHub Desktop.
CreateCertForAppReg.ps1
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
$CN = "MyAppReg" #Name of your cert. | |
$cert=New-SelfSignedCertificate -Subject "CN=$CN" -CertStoreLocation "Cert:\CurrentUser\My" -KeyExportPolicy Exportable -KeySpec Signature -NotAfter (Get-Date).AddYears(5) | |
#Thumbprint - Make note of this | |
$Thumbprint = $Cert.Thumbprint | |
#Export cert. to download folder - FilePath can be changed to your linking | |
Get-ChildItem Cert:\CurrentUser\my\$Thumbprint | Export-Certificate -FilePath $env:USERPROFILE\Downloads\AppRegCert.cer | |
Write-Output "$Thumbprint <- Copy/paste this (save it)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment