Skip to content

Commit 27f95a0

Browse files
author
John Billekens
committed
Update GenLeCertForNS.ps1
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.
1 parent f918ac4 commit 27f95a0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

GenLeCertForNS.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
Removing ALL the test certificates from your ADC.
9191
.NOTES
9292
File Name : GenLeCertForNS.ps1
93-
Version : v2.2.1
93+
Version : v2.2.2
9494
Author : John Billekens
9595
Requires : PowerShell v5.1 and up
9696
ADC 11.x and up
@@ -257,7 +257,8 @@ param(
257257

258258
#requires -version 5.1
259259
#requires -runasadministrator
260-
$ScriptVersion = "v2.2.0"
260+
$ScriptVersion = "v2.2.2
261+
"
261262

262263
#region Functions
263264

@@ -1589,11 +1590,11 @@ if ((-not $CleanNS) -and (-not $RemoveTestCertificates) -and ($ValidationMethod
15891590
#region Certificates
15901591

15911592
if ((-not ($CleanNS)) -and (-not ($RemoveTestCertificates))) {
1592-
$CertificateAlias = "CRT-SAN-$SessionDateTime-$CN"
1593+
$CertificateAlias = "CRT-SAN-$SessionDateTime-$($CN.Replace('*.',''))"
15931594
$CertificateDirectory = Join-Path -Path $CertDir -ChildPath $CertificateAlias
15941595
Write-Verbose "Create directory `"$CertificateDirectory`" for storing the new certificates"
15951596
New-Item $CertificateDirectory -ItemType directory -force | Out-Null
1596-
$CertificateName = "$($ScriptDateTime.ToString("yyyyMMddHHmm"))-$cn"
1597+
$CertificateName = "$($ScriptDateTime.ToString("yyyyMMddHHmm"))-$($CN.Replace('*.',''))"
15971598
if (Test-Path $CertificateDirectory) {
15981599
if ($Production) {
15991600
Write-Verbose "Writing production certificates"

0 commit comments

Comments
 (0)