From 483356136cccae478e7df97e990f31f63c8617ea Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Wed, 25 Mar 2020 17:53:18 +0100 Subject: [PATCH] Adds support for auto loading third-party module eventlog messages --- icinga-powershell-framework.psm1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/icinga-powershell-framework.psm1 b/icinga-powershell-framework.psm1 index 640926c..f29560c 100644 --- a/icinga-powershell-framework.psm1 +++ b/icinga-powershell-framework.psm1 @@ -29,6 +29,15 @@ function Use-Icinga() Import-IcingaLib '\' -Init -Custom; Import-IcingaLib '\' -Init; + $EventLogMessages = Invoke-IcingaNamespaceCmdlets -Command 'Register-IcingaEventLogMessages*'; + foreach ($entry in $EventLogMessages.Values) { + foreach ($event in $entry.Keys) { + Add-IcingaHashtableItem -Hashtable $global:IcingaEventLogEnums ` + -Key $event ` + -Value $entry[$event] | Out-Null; + } + } + if ($LibOnly -eq $FALSE) { Register-IcingaEventLog;