Update vCenter-SSL.ps1
This commit is contained in:
@@ -50,9 +50,9 @@ function Show-Failure {
|
||||
$msg = $ErrorRecord.Exception.Message
|
||||
|
||||
Write-Log ERROR $msg Red
|
||||
Write-Host "======================================================" Red
|
||||
Write-Host "ERROR: $msg" Red
|
||||
Write-Host "======================================================" Red
|
||||
Write-Host "======================================================" -ForegroundColor Red
|
||||
Write-Host "ERROR: $msg" -ForegroundColor Red
|
||||
Write-Host "======================================================" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -93,9 +93,9 @@ try {
|
||||
Write-Log INFO "Connecting to vCenter $VCENTERHOST..."
|
||||
Connect-VIServer -Server $VCENTERHOST -User $VCENTERUSER -Password $VCENTERPASS -Force | Out-Null
|
||||
|
||||
Write-Host "========================================"
|
||||
Write-Host "SUCCESS: Connected to vCenter."
|
||||
Write-Host "========================================"
|
||||
Write-Host "========================================" -ForegroundColor Green
|
||||
Write-Host "SUCCESS: Connected to vCenter." -ForegroundColor Green
|
||||
Write-Host "========================================" -ForegroundColor Green
|
||||
} catch { Show-Failure $_ }
|
||||
|
||||
# ----------------------------
|
||||
@@ -256,9 +256,9 @@ if ($needNewCert) {
|
||||
try {
|
||||
Set-VIMachineCertificate -PemCertificate $leafPem -PemKey $keyPem -Confirm:$false | Out-Null
|
||||
|
||||
Write-Host "==========================================================="
|
||||
Write-Host "===========================================================" -ForegroundColor Green
|
||||
Write-Host "SUCCESS: vCenter Machine SSL certificate updated." ForegroundColor Green
|
||||
Write-Host "==========================================================="
|
||||
Write-Host "===========================================================" -ForegroundColor Green
|
||||
|
||||
Write-Log INFO "Certificate updated successfully."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user