Skip to content

Commit

Permalink
Update GenLeCertForNS.ps1
Browse files Browse the repository at this point in the history
Fixed an issue for when you configured *.domain.com as CN the script returned an error, New-Item : Illegal characters in path. Thank you
https://twitter.com/virtualwebber for pointing this out and helping me testing.
  • Loading branch information
John Billekens committed Mar 14, 2019
1 parent f918ac4 commit 27f95a0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions GenLeCertForNS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
Removing ALL the test certificates from your ADC.
.NOTES
File Name : GenLeCertForNS.ps1
Version : v2.2.1
Version : v2.2.2
Author : John Billekens
Requires : PowerShell v5.1 and up
ADC 11.x and up
Expand Down Expand Up @@ -257,7 +257,8 @@ param(

#requires -version 5.1
#requires -runasadministrator
$ScriptVersion = "v2.2.0"
$ScriptVersion = "v2.2.2
"

#region Functions

Expand Down Expand Up @@ -1589,11 +1590,11 @@ if ((-not $CleanNS) -and (-not $RemoveTestCertificates) -and ($ValidationMethod
#region Certificates

if ((-not ($CleanNS)) -and (-not ($RemoveTestCertificates))) {
$CertificateAlias = "CRT-SAN-$SessionDateTime-$CN"
$CertificateAlias = "CRT-SAN-$SessionDateTime-$($CN.Replace('*.',''))"
$CertificateDirectory = Join-Path -Path $CertDir -ChildPath $CertificateAlias
Write-Verbose "Create directory `"$CertificateDirectory`" for storing the new certificates"
New-Item $CertificateDirectory -ItemType directory -force | Out-Null
$CertificateName = "$($ScriptDateTime.ToString("yyyyMMddHHmm"))-$cn"
$CertificateName = "$($ScriptDateTime.ToString("yyyyMMddHHmm"))-$($CN.Replace('*.',''))"
if (Test-Path $CertificateDirectory) {
if ($Production) {
Write-Verbose "Writing production certificates"
Expand Down

0 comments on commit 27f95a0

Please # to comment.