我有一个本地包源来处理一些事情。我创建了一个名为 的脑死包CoolUtils
,使用nuget add
. 您可以使用 nuget 找到它:
PS> nuget list -source E:\nuget-repo-test-01\
CoolUtils 2.0.20171024.1
PS> nuget list coolutils -source E:\nuget-repo-test-01\
CoolUtils 2.0.20171024.1
但是,Find-Package
无法通过名称找到它,但可以使用通配符或未指定名称找到它:
PS> Find-Package -Source E:\nuget-repo-test-01\
Name Version Source Summary
---- ------- ------ -------
CoolUtils 2.0.20171024.1 E:\nuget-repo-test-01\ Test package with dumb scripts.
PS> Find-Package *cool* -Source E:\nuget-repo-test-01\
Name Version Source Summary
---- ------- ------ -------
CoolUtils 2.0.20171024.1 E:\nuget-repo-test-01\ Test package with dumb scripts.
PS> Find-Package CoolUtils -Source E:\nuget-repo-test-01\
Find-Package : No match was found for the specified search criteria and package name 'CoolUtils'. Try Get-PackageSource to see all available registered package sources.
At line:1 char:1
+ Find-Package CoolUtils -Source E:\nuget-repo-test-01\
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage
我也无法使用 安装它Install-Package
,尽管我可以使用nuget
.