fix: require site and correct Intune installation detection
Build Windows agent / build (win-arm64) (push) Canceled after 0s
Build Windows agent / build (win-x64) (push) Canceled after 0s

This commit is contained in:
2026-07-21 14:58:43 +02:00
parent d8f3820dae
commit 6c2770d932
3 changed files with 30 additions and 5 deletions
+4 -1
View File
@@ -25,4 +25,7 @@ $trigger = New-ScheduledTaskTrigger -Daily -At $StartTime
$principal = New-ScheduledTaskPrincipal -UserId 'S-1-5-18' -LogonType ServiceAccount -RunLevel Highest
$settings = New-ScheduledTaskSettingsSet -StartWhenAvailable -ExecutionTimeLimit (New-TimeSpan -Minutes 15)
Register-ScheduledTask -TaskName 'NetBox Windows Agent' -Action $action -Trigger $trigger -Principal $principal -Settings $settings -Force | Out-Null
& (Join-Path $InstallDirectory 'agent.exe') --config (Join-Path $InstallDirectory 'config.json')
& $agentPath --config $configPath
if ($LASTEXITCODE -ne 0) { throw "Die erste NetBox-Synchronisation ist mit Exitcode $LASTEXITCODE fehlgeschlagen." }
Write-Host 'NetBox Windows Agent wurde erfolgreich installiert und synchronisiert.'
exit 0