loic-sharma / BaGet

A lightweight NuGet and symbol server
https://loic-sharma.github.io/BaGet/
MIT License
2.61k stars 666 forks source link

searching for exact package results in error #565

Open ipetko96 opened 4 years ago

ipetko96 commented 4 years ago

If I list all packages, everything work as expected. But when I try to search for the exact package by it's name, I always end up with the error.

I am using release version v0.3.0-preview4 of BaGet. I updated all PackageManagement tools (NuGet, PowerShellGet) to the most recent version in PowerShell. Here is the transcript from PowerShell

**********************
Windows PowerShell transcript start
Start time: 20200723120814
Username: INVIA\ivan.petko
RunAs User: INVIA\ivan.petko
Configuration Name: 
Machine: WKS-NT131 (Microsoft Windows NT 10.0.18363.0)
Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Process ID: 19048
PSVersion: 5.1.18362.752
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.18362.752
BuildVersion: 10.0.18362.752
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1
**********************
Transcript started, output file is C:\Users\ivan.petko\Documents\PowerShell_transcript.WKS-NT131.0PiGbkZD.20200723120814.txt
PS C:\Users\ivan.petko> Get-PackageProvider

Name                     Version          DynamicOptions
----                     -------          --------------
msi                      3.0.0.0          AdditionalArguments
msu                      3.0.0.0
NuGet                    3.0.0.1          Destination, ExcludeVersion, Scope, SkipDependencies, Headers, FilterOnTag...
PowerShellGet            2.2.4.1          PackageManagementProvider, Type, Scope, AllowClobber, SkipPublisherCheck, ...
Programs                 3.0.0.0          IncludeWindowsInstaller, IncludeSystemComponent

PS C:\Users\ivan.petko> Get-PackageSource

Name                             ProviderName     IsTrusted  Location
----                             ------------     ---------  --------
nuget.org                        NuGet            False      http://api.nuget.org/v3/index.json
Microsoft Visual Studio Offli... NuGet            False      C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
Dotvvm Feed                      NuGet            False      https://www.dotvvm.com/nuget/v3/index.json
PSGallery                        PowerShellGet    False      https://www.powershellgallery.com/api/v2

PS C:\Users\ivan.petko> Register-PackageSource -Name "ipet-baget" -Location "http://localhost:5000/v3/index.json" -Trusted -ProviderName "PowerShellGet"

Name                             ProviderName     IsTrusted  Location
----                             ------------     ---------  --------
ipet-baget                       PowerShellGet    True       http://localhost:5000/v3/index.json

PS C:\Users\ivan.petko> Get-PackageSource

Name                             ProviderName     IsTrusted  Location
----                             ------------     ---------  --------
nuget.org                        NuGet            False      http://api.nuget.org/v3/index.json
Microsoft Visual Studio Offli... NuGet            False      C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
Dotvvm Feed                      NuGet            False      https://www.dotvvm.com/nuget/v3/index.json
PSGallery                        PowerShellGet    False      https://www.powershellgallery.com/api/v2
ipet-baget                       PowerShellGet    True       http://localhost:5000/v3/index.json

PS C:\Users\ivan.petko> Find-Package -Source "ipet-baget"

Name                           Version          Source           Summary
----                           -------          ------           -------
Invia.Hangfire.Jobs            1.0.140          ipet-baget       Implementation of scheduled jobs used bz task sched...
Invia.Hangfire.Jobs.NETStan... 1.0.5            ipet-baget       Package Description

PS C:\Users\ivan.petko> Find-Package -Source "ipet-baget" -Name "Invia.Hangfire.Jobs"
Find-Package : No match was found for the specified search criteria and package name 'Invia.Hangfire.Jobs'. Try Get-Pack
ageSource to see all available registered package sources.
At line:1 char:1
+ Find-Package -Source "ipet-baget" -Name "Invia.Hangfire.Jobs"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exception
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage
Find-Package : No match was found for the specified search criteria and package name 'Invia.Hangfire.Jobs'. Try Get-Pac
kageSource to see all available registered package sources.
At line:1 char:1
+ Find-Package -Source "ipet-baget" -Name "Invia.Hangfire.Jobs"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exceptio
   n
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage

PS C:\Users\ivan.petko> Unregister-PackageSource -Source "ipet-baget"
PS C:\Users\ivan.petko> Get-PackageSource

Name                             ProviderName     IsTrusted  Location
----                             ------------     ---------  --------
nuget.org                        NuGet            False      http://api.nuget.org/v3/index.json
Microsoft Visual Studio Offli... NuGet            False      C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
Dotvvm Feed                      NuGet            False      https://www.dotvvm.com/nuget/v3/index.json
PSGallery                        PowerShellGet    False      https://www.powershellgallery.com/api/v2

PS C:\Users\ivan.petko> Register-PackageSource -Name "ipet-baget" -Location "http://localhost:5000/v3/index.json" -Trusted -ProviderName "NuGet"

Name                             ProviderName     IsTrusted  Location
----                             ------------     ---------  --------
ipet-baget                       NuGet            True       http://localhost:5000/v3/index.json

PS C:\Users\ivan.petko> Get-PackageSource

Name                             ProviderName     IsTrusted  Location
----                             ------------     ---------  --------
nuget.org                        NuGet            False      http://api.nuget.org/v3/index.json
Microsoft Visual Studio Offli... NuGet            False      C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
Dotvvm Feed                      NuGet            False      https://www.dotvvm.com/nuget/v3/index.json
ipet-baget                       NuGet            True       http://localhost:5000/v3/index.json
PSGallery                        PowerShellGet    False      https://www.powershellgallery.com/api/v2

PS C:\Users\ivan.petko> Find-Package -Source "ipet-baget"

Name                           Version          Source           Summary
----                           -------          ------           -------
Invia.Hangfire.Jobs            1.0.140          ipet-baget       Implementation of scheduled jobs used bz task sched...
Invia.Hangfire.Jobs.NETStan... 1.0.5            ipet-baget       Package Description

PS C:\Users\ivan.petko> Find-Package -Source "ipet-baget" -Name "Invia.Hangfire.Jobs"
Find-Package : No match was found for the specified search criteria and package name 'Invia.Hangfire.Jobs'. Try Get-Pack
ageSource to see all available registered package sources.
At line:1 char:1
+ Find-Package -Source "ipet-baget" -Name "Invia.Hangfire.Jobs"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exception
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage
Find-Package : No match was found for the specified search criteria and package name 'Invia.Hangfire.Jobs'. Try Get-Pac
kageSource to see all available registered package sources.
At line:1 char:1
+ Find-Package -Source "ipet-baget" -Name "Invia.Hangfire.Jobs"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exceptio
   n
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage

PS C:\Users\ivan.petko> Stop-Transcript
**********************
Windows PowerShell transcript end
End time: 20200723121321
**********************

Expected behavior

I should get only the package with the searched name.

yaurora commented 3 years ago

I have similar issue:

  1. The search result shows me available module but when I try to install it, there is no success
PS C:\WINDOWS\system32> Get-PSRepository

Name                      InstallationPolicy   SourceLocation                                                                                                                                                                                                    
----                      ------------------   --------------                                                                                                                                                                                                    
PSGallery                 Untrusted            https://www.powershellgallery.com/api/v2                                                                                                                                                                          
BaGet                     Trusted              http://192.168.100.1:5000/v3/index.json

PS C:\WINDOWS\system32> Find-Module -Repository baget

Version    Name                                Repository           Description                                                                                                                                                                                  
-------    ----                                ----------           -----------                                                                                                                                                                                  
2.2.0.2    PSWindowsUpdate                     BaGet                This module contain cmdlets to manage Windows Update Client.  

PS C:\WINDOWS\system32> Install-Module -Name PSWindowsUpdate -Repository baget
PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'PSWindowsUpdate'. Try Get-PSRepository to see all available registered module repositories.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage