Skip to content

Commit

Permalink
dates are only valid for self-signed certs (do New-DbaComputerCertifi…
Browse files Browse the repository at this point in the history
…cate)
  • Loading branch information
andreasjordan committed Apr 3, 2024
1 parent 86b3f3d commit 596e671
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/New-DbaComputerCertificate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,11 @@ function New-DbaComputerCertificate {
Add-Content $certCfg "ProviderType = 12"
if ($SelfSigned) {
Add-Content $certCfg "RequestType = Cert"
Add-Content $certCfg "NotBefore = $((get-date).ToShortDateString())"
Add-Content $certCfg "NotAfter = $((get-date).AddMonths($MonthsValid).ToShortDateString())"
} else {
Add-Content $certCfg "RequestType = PKCS10"
}
Add-Content $certCfg "NotBefore = $((get-date).ToShortDateString())"
Add-Content $certCfg "NotAfter = $((get-date).AddMonths($MonthsValid).ToShortDateString())"
Add-Content $certCfg "HashAlgorithm = $HashAlgorithm"
Add-Content $certCfg "KeyUsage = 0xa0"
Add-Content $certCfg "[EnhancedKeyUsageExtension]"
Expand Down

0 comments on commit 596e671

Please sign in to comment.