Skip to content

Commit

Permalink
New-DbaComputerCertifficate - Only use MonthsValid for self-signed ce…
Browse files Browse the repository at this point in the history
…rtificates (#9318)
  • Loading branch information
andreasjordan authored Apr 11, 2024
1 parent 7043c26 commit 95c9644
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 95c9644

Please sign in to comment.