Skip to content

Instantly share code, notes, and snippets.

View dmauser's full-sized avatar

Daniel Mauser dmauser

View GitHub Profile
@dmauser
dmauser / Powershell-Certificates-BRIEF.ps1
Last active December 7, 2022 16:54 — forked from RomelSan/Powershell-Certificates-BRIEF.ps1
Powershell Self Signed Certificate
#-------------------------------------------------------------------------------------
# Create Self signed root certificate
# -dnsname -DnsName domain.example.com,anothersubdomain.example.com
# -Subject "CN=Patti Fuller,OU=UserAccounts,DC=corp,DC=contoso,DC=com"
$cert = New-SelfSignedCertificate -Type Custom -KeySpec Signature `
-Subject "CN=RootCert" `
-KeyExportPolicy Exportable `
-HashAlgorithm sha256 -KeyLength 4096 `
-CertStoreLocation "Cert:\CurrentUser\My" `
-KeyUsageProperty Sign `