mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
16 lines
630 B
PowerShell
16 lines
630 B
PowerShell
function Register-IcingaEventLog()
|
|
{
|
|
param (
|
|
[string]$LogName = $null
|
|
);
|
|
|
|
if ([string]::IsNullOrEmpty($LogName)) {
|
|
New-EventLog -LogName 'Icinga for Windows' -Source 'IfW::Framework' -ErrorAction SilentlyContinue;
|
|
New-EventLog -LogName 'Icinga for Windows' -Source 'IfW::Service' -ErrorAction SilentlyContinue;
|
|
New-EventLog -LogName 'Icinga for Windows' -Source 'IfW::Debug' -ErrorAction SilentlyContinue;
|
|
} else {
|
|
$LogName = [string]::Format('IfW::{0}', $LogName);
|
|
|
|
New-EventLog -LogName 'Icinga for Windows' -Source $LogName -ErrorAction SilentlyContinue;
|
|
}
|
|
}
|