Commit aa5ecab3 authored by Ben Galloway's avatar Ben Galloway

Improve log output

parent e3590c8b
......@@ -11,16 +11,6 @@ catch {
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 {
$certInfo = (Get-PfxCertificate -FilePath gsc.org.uk.pfx)
Write-Output ""
......@@ -35,6 +25,16 @@ catch {
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
try {
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
......@@ -56,7 +56,7 @@ catch {
Write-Output ""
Write-Output "========================="
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 "========================="
Write-Output ""
......@@ -12,16 +12,6 @@ catch {
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 {
$certInfo = (Get-PfxCertificate -FilePath gsc.org.uk.pfx)
Write-Output ""
......@@ -36,6 +26,16 @@ catch {
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
try {
Import-Module WebAdministration
......@@ -59,7 +59,7 @@ catch {
Write-Output ""
Write-Output "========================="
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 "========================="
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