internal async Task <CheckUpdateResult?> CheckUpdateForTemplate(ITemplateInfo template, INewCommandInput commandInput, CancellationToken cancellationToken = default) { _ = template ?? throw new ArgumentNullException(nameof(template)); _ = commandInput ?? throw new ArgumentNullException(nameof(commandInput)); cancellationToken.ThrowIfCancellationRequested(); ITemplatePackage templatePackage; try { templatePackage = await template.GetTemplatePackageAsync(_engineEnvironmentSettings).ConfigureAwait(false); } catch (Exception) { Reporter.Error.WriteLine(string.Format(LocalizableStrings.TemplatePackageCoordinator_Error_PackageForTemplateNotFound, template.Identity)); return(null); } if (!(templatePackage is IManagedTemplatePackage managedTemplatePackage)) { //update is not supported - built-in or optional workload source return(null); } InitializeNuGetCredentialService(commandInput); return((await managedTemplatePackage.ManagedProvider.GetLatestVersionsAsync(new[] { managedTemplatePackage }, cancellationToken).ConfigureAwait(false)).Single()); }