Framework/Listeners/ListenerHelper.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Set-StrictMode -Version Latest
#Class to register appropriate listeners based on environment
class ListenerHelper
{
    static ListenerHelper()
    {
    }

    static [void] RegisterListeners()
    {
        [WriteFolderPath]::GetInstance().RegisterEvents();
        [WriteDetailedLog]::GetInstance().RegisterEvents();
        [WriteSummaryFile]::GetInstance().RegisterEvents();
        [WritePsConsole]::GetInstance().RegisterEvents();
        [WriteDataFile]::GetInstance().RegisterEvents();
        [OMSOutput]::GetInstance().RegisterEvents();
        [EventHubOutput]::GetInstance().RegisterEvents();
        [WebhookOutput]::GetInstance().RegisterEvents();
        [AIOrgTelemetry]::GetInstance().RegisterEvents();
        [UsageTelemetry]::GetInstance().RegisterEvents();
        [RemoteReportsListner]::GetInstance().RegisterEvents();
        [WriteEnvironmentFile]::GetInstance().RegisterEvents();
        [WriteCAStatus]::GetInstance().RegisterEvents();
        [WriteFixControlFiles]::GetInstance().RegisterEvents();
    }


    static [void] UnregisterListeners()
    {
        [WriteFolderPath]::GetInstance().UnregisterEvents();
        [WriteDetailedLog]::GetInstance().UnregisterEvents();
        [WriteSummaryFile]::GetInstance().UnregisterEvents();
        [WritePsConsole]::GetInstance().UnregisterEvents();
        [WriteDataFile]::GetInstance().UnregisterEvents();
        [OMSOutput]::GetInstance().UnregisterEvents();
        [EventHubOutput]::GetInstance().UnregisterEvents();
        [WebhookOutput]::GetInstance().UnregisterEvents();
        [AIOrgTelemetry]::GetInstance().UnregisterEvents();
        [UsageTelemetry]::GetInstance().UnregisterEvents();
        [RemoteReportsListner]::GetInstance().UnregisterEvents();
        [WriteEnvironmentFile]::GetInstance().UnregisterEvents();
        [WriteCAStatus]::GetInstance().UnregisterEvents();
        [WriteFixControlFiles]::GetInstance().UnregisterEvents();
    }
}
#[ListenerHelper]::RegisterListeners();