Files
HostAvailabilityMonitor/scripts/register-event-source.ps1
T

17 lines
397 B
PowerShell

param(
[Parameter(Mandatory = $true)]
[string]$Source,
[string]$LogName = "Application"
)
$ErrorActionPreference = "Stop"
if (-not [System.Diagnostics.EventLog]::SourceExists($Source)) {
New-EventLog -LogName $LogName -Source $Source
Write-Host "Event Source '$Source' wurde in '$LogName' angelegt."
}
else {
Write-Host "Event Source '$Source' existiert bereits."
}