diff --git a/src/chocolatey/infrastructure.app/nuget/NugetList.cs b/src/chocolatey/infrastructure.app/nuget/NugetList.cs index b98d9f6977..eddaef0426 100644 --- a/src/chocolatey/infrastructure.app/nuget/NugetList.cs +++ b/src/chocolatey/infrastructure.app/nuget/NugetList.cs @@ -61,9 +61,14 @@ private static IQueryable execute_package_search(ChocolateyConfigurati IQueryable results = packageRepository.Search(searchTermLower, configuration.Prerelease); + SemanticVersion version = !string.IsNullOrWhiteSpace(configuration.Version) ? new SemanticVersion(configuration.Version) : null; + if (configuration.ListCommand.Exact) { - results = packageRepository.FindPackagesById(searchTermLower).AsQueryable(); + return new List() + { + find_package(searchTermLower, version, configuration, packageRepository) + }.AsQueryable(); } if (configuration.ListCommand.Page.HasValue)