public override async Task StartAsync(PerformContext performContext) { await ExecuteAsync(performContext, async() => { if (!_veeamManager.IsOnline()) { performContext?.WriteErrorLine("The Veeam server does not appear to be online. Please make sure all Veeam services are started before retrying this operation again."); Logger.Error("Veeam server not online."); return; } Logger.Info(performContext, "Collecting information...this could take some time."); Veeam payload = _veeamManager.GetLicensingInformation(performContext); Logger.Info(performContext, "done"); Logger.Info(performContext, "Validating the payload..."); var remoteVeeam = PortalService.GetVeeamServerById(AuthService.GetDevice()); if (remoteVeeam.Count != 1) { payload.Validate(); Logger.Info(performContext, "Payload is valid!"); DumpPayload(payload); await PortalService.AddVeeamServerAsync(payload); Logger.Info(performContext, "Successfully checked in."); return; } remoteVeeam[0].UpdateValues(payload); remoteVeeam[0].Validate(); Logger.Info(performContext, "Payload is valid!"); DumpPayload(payload); await PortalService.UpdateVeeamServerAsync(remoteVeeam[0]); Logger.Info(performContext, "Successfully checked in."); }); }