Files
HostAvailabilityMonitor/scripts/generate-monitor-config.ps1

26 lines
649 B
PowerShell

param(
[string]$InstallPath = 'C:\Tools\BizTalkMonitorConfigGenerator',
[string]$ConfigPath
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
if (-not $ConfigPath) {
$ConfigPath = Join-Path $InstallPath 'generator-settings.json'
}
$exePath = Join-Path $InstallPath 'BizTalkMonitorConfigGenerator.exe'
if (-not (Test-Path -LiteralPath $exePath)) {
throw "Executable wurde nicht gefunden: $exePath"
}
if (-not (Test-Path -LiteralPath $ConfigPath)) {
throw "Konfigurationsdatei wurde nicht gefunden: $ConfigPath"
}
& $exePath $ConfigPath
$exitCode = $LASTEXITCODE
Write-Host "ExitCode: $exitCode"
exit $exitCode