Commit aa5ecab3 authored by Ben Galloway's avatar Ben Galloway

Improve log output

parent e3590c8b
...@@ -11,16 +11,6 @@ catch { ...@@ -11,16 +11,6 @@ catch {
throw $_ throw $_
} }
try {
Write-Output "Importing certificate to local store..."
echo "" | certutil -importpfx .\gsc.org.uk.pfx
}
catch {
Write-Output "Failed to import certificate."
Write-Output "The error was as follows:"
throw $_
}
try { try {
$certInfo = (Get-PfxCertificate -FilePath gsc.org.uk.pfx) $certInfo = (Get-PfxCertificate -FilePath gsc.org.uk.pfx)
Write-Output "" Write-Output ""
...@@ -35,6 +25,16 @@ catch { ...@@ -35,6 +25,16 @@ catch {
throw $_ throw $_
} }
try {
Write-Output "Importing certificate to local store..."
echo "" | certutil -importpfx .\gsc.org.uk.pfx
}
catch {
Write-Output "Failed to import certificate."
Write-Output "The error was as follows:"
throw $_
}
# FOR EXCHANGE # FOR EXCHANGE
try { try {
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
...@@ -56,7 +56,7 @@ catch { ...@@ -56,7 +56,7 @@ catch {
Write-Output "" Write-Output ""
Write-Output "=========================" Write-Output "========================="
Write-Output "SUCCESS!" Write-Output "SUCCESS!"
Write-Output "The certificate with thumbprint $($certInfo.Thumbprint) was successfully installed" Write-Output "The certificate is now in use"
Write-Output "and will expire on $(($certInfo.NotAfter).ToString("dd MMMM yyyy"))" Write-Output "and will expire on $(($certInfo.NotAfter).ToString("dd MMMM yyyy"))"
Write-Output "=========================" Write-Output "========================="
Write-Output "" Write-Output ""
...@@ -12,16 +12,6 @@ catch { ...@@ -12,16 +12,6 @@ catch {
throw $_ throw $_
} }
try {
Write-Output "Importing certificate to local store..."
echo "" | certutil -importpfx .\gsc.org.uk.pfx
}
catch {
Write-Output "Failed to import certificate."
Write-Output "The error was as follows:"
throw $_
}
try { try {
$certInfo = (Get-PfxCertificate -FilePath gsc.org.uk.pfx) $certInfo = (Get-PfxCertificate -FilePath gsc.org.uk.pfx)
Write-Output "" Write-Output ""
...@@ -36,6 +26,16 @@ catch { ...@@ -36,6 +26,16 @@ catch {
throw $_ throw $_
} }
try {
Write-Output "Importing certificate to local store..."
echo "" | certutil -importpfx .\gsc.org.uk.pfx
}
catch {
Write-Output "Failed to import certificate."
Write-Output "The error was as follows:"
throw $_
}
# FOR IIS # FOR IIS
try { try {
Import-Module WebAdministration Import-Module WebAdministration
...@@ -59,7 +59,7 @@ catch { ...@@ -59,7 +59,7 @@ catch {
Write-Output "" Write-Output ""
Write-Output "=========================" Write-Output "========================="
Write-Output "SUCCESS!" Write-Output "SUCCESS!"
Write-Output "The certificate with thumbprint $($certInfo.Thumbprint) was successfully installed" Write-Output "The certificate is now in use"
Write-Output "and will expire on $(($certInfo.NotAfter).ToString("dd MMMM yyyy"))" Write-Output "and will expire on $(($certInfo.NotAfter).ToString("dd MMMM yyyy"))"
Write-Output "=========================" Write-Output "========================="
Write-Output "" Write-Output ""
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment