diff --git a/inc/vCenter-SSL.ps1 b/inc/vCenter-SSL.ps1 index 01db240a..106a89c6 100644 --- a/inc/vCenter-SSL.ps1 +++ b/inc/vCenter-SSL.ps1 @@ -38,15 +38,19 @@ function Show-Banner { "WARN" { $color = "Yellow"; $level = "WARN" } default { $color = "Cyan"; $level = "INFO" } } + $line = ("=" * [Math]::Max($Text.Length, 40)) + Write-Host $line -ForegroundColor $color - Write-Host "$level: $Text" -ForegroundColor $color + Write-Host "${level}: $Text" -ForegroundColor $color Write-Host $line -ForegroundColor $color + $ts = Get-Date -Format "yyyy-MM-dd HH:mm:ss" $log = "[{0}] {1}: {2}" -f $ts, $level, $Text Add-Content -Path $LogFile -Value $log } + # ---------------------------- # Global variables for troubleshooting # ----------------------------