diff --git a/Updater/Update-Service.ps1 b/Updater/Update-Service.ps1 index 6657a902f3d54fa09e0565fa2f3826567180ab15..6d94025562383c77822bddd75077a5af6c79e546 100644 --- a/Updater/Update-Service.ps1 +++ b/Updater/Update-Service.ps1 @@ -386,6 +386,16 @@ catch { Exit } +if (-Not ([System.Diagnostics.EventLog]::SourceExists($ServiceName))) { + try { + New-EventLog -LogName Application -Source $ServiceName + } + catch { + $ex = $_.Exception.Message + Write-Verbose "Error creating event log source: $($ex)" + } +} + # NOTE: $MyInvocation is not available when run as ScheduledJob, so we have to # set a shortcut for our name explicitly ourselves here: