Find Package with source parameter is not working to get the current versions of all the nuget packages
Find-Package -Source "C:\Users\P10410559\source\repos\WebApplication4\WebApplication4\packages.config"
Error getting as :
Find-Package : The following source failed to search for packages: 'C:\Users\P10410559\source\repos\WebApplication4\WebApplication4\packages.config'
The path 'C:\Users\P10410559\source\repos\WebApplication4\WebApplication4\packages.config' for the selected source could not be resolved.
At line:1 char:1
+ Find-Package -Source "C:\Users\P10410559\source\repos\WebApplication4 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Find-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.FindPackageCommand
You are trying to search for packages inside a packages.config, which is incorrect for the following reasons -
Find-Package nuget.versioning -Source https://api.nuget.org/v3/index.jsonIf you want to get current version of all packages installed to your project you need to use the Get-Package command described here. E.g. -
Get-Package -ProjectName NuGet.Versioning