Initial version of the .NET HostAvailabilityMonitor.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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."
|
||||
}
|
||||
Reference in New Issue
Block a user