fix: use native scheduled task cmdlets and improve error diagnostics
Build Windows agent / build (win-arm64) (push) Has been cancelled
Build Windows agent / build (win-x64) (push) Has been cancelled

This commit is contained in:
2026-07-21 13:43:25 +02:00
parent 6989680340
commit 61aa9ad61b
3 changed files with 17 additions and 5 deletions
+8 -1
View File
@@ -21,7 +21,14 @@ static async Task<int> MainAsync(string[] args)
Console.WriteLine(dryRun ? "Dry-Run erfolgreich; keine Änderungen geschrieben." : $"Synchronisiert: Device #{result.DeviceId}, Asset #{result.AssetId}");
return 0;
}
catch (Exception ex) { Console.Error.WriteLine($"FEHLER: {ex.Message}"); return 1; }
catch (Exception ex)
{
var messages = new List<string>();
for (Exception? current = ex; current is not null; current = current.InnerException)
if (!messages.Contains(current.Message)) messages.Add(current.Message);
Console.Error.WriteLine($"FEHLER: {string.Join(" -> ", messages)}");
return 1;
}
}
static string? ValueAfter(string[] args, string key) { var i = Array.IndexOf(args, key); return i >= 0 && i + 1 < args.Length ? args[i + 1] : null; }
static void Validate(AgentConfig c)