From 57e47c62e77edf99f7095233f5d0d178dd2bce10 Mon Sep 17 00:00:00 2001 From: smanross <36727473+smanross@users.noreply.github.com> Date: Wed, 5 Jun 2019 09:57:14 -0700 Subject: [PATCH] update to get SANs working correcty old version placed [Extensions] and first line of SAN on previous line due to '@ not being on beginning of line and so the requests.inf didn't get created properly **also added Write-Debug $file to help me diagnose this issue. --- Request-Certificate.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Request-Certificate.ps1 b/Request-Certificate.ps1 index 64ca140..2b101e8 100644 --- a/Request-Certificate.ps1 +++ b/Request-Certificate.ps1 @@ -251,7 +251,8 @@ CertificateTemplate = "$TemplateName" Write-Verbose "A value for the SAN is specified. Requesting a SAN certificate." Write-Debug "Add Extension for SAN to the inf file..." - $file += @' + $file += +@' [Extensions] ; If your client operating system is Windows Server 2008, Windows Server 2008 R2, Windows Vista, or Windows 7 @@ -278,6 +279,9 @@ CertificateTemplate = "$TemplateName" $rsp = Join-Path -Path $env:TEMP -ChildPath "$CN.rsp" Remove-ReqTempfiles -tempfiles $inf, $req, $cer, $rsp + + #write the file to debug logs (if debug enabled) + Write-Debug $file #create new request inf file Set-Content -Path $inf -Value $file