diff --git a/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp b/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp index 50d233179d..3d998125ec 100644 --- a/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp +++ b/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp @@ -673,11 +673,16 @@ namespace AppInstaller::CLI::Workflow { Utility::LocIndString availableVersion, sourceName; - if (updateAvailable) + if (latestVersion) { - availableVersion = latestVersion->GetProperty(PackageVersionProperty::Version); + if (updateAvailable) + { + availableVersion = latestVersion->GetProperty(PackageVersionProperty::Version); + availableUpgradesCount++; + } + + // Always show the source for correlated packages sourceName = latestVersion->GetProperty(PackageVersionProperty::SourceName); - availableUpgradesCount++; } table.OutputLine({ @@ -696,14 +701,20 @@ namespace AppInstaller::CLI::Workflow if (table.IsEmpty()) { context.Reporter.Info() << Resource::String::NoInstalledPackageFound << std::endl; - } else if (m_onlyShowUpgrades) { - context.Reporter.Info() << availableUpgradesCount << ' ' << Resource::String::AvailableUpgrades << std::endl; } - - if (searchResult.Truncated) + else { - context.Reporter.Info() << '<' << Resource::String::SearchTruncated << '>' << std::endl; + if (searchResult.Truncated) + { + context.Reporter.Info() << '<' << Resource::String::SearchTruncated << '>' << std::endl; + } + + if (m_onlyShowUpgrades) + { + context.Reporter.Info() << availableUpgradesCount << ' ' << Resource::String::AvailableUpgrades << std::endl; + } } + } void EnsureMatchesFromSearchResult::operator()(Execution::Context& context) const