如何使用 nuget.org 中的 OneGet / install-package 安装包

How do I install a package using OneGet / install-package from nuget.org

我正在尝试从这里安装 Microsoft.Experimental.IO 库:https://www.nuget.org/packages/Microsoft.Experimental.IO/1.0.0 on Windows 10 using Powershell - Install-Package。

我已经添加了 nuget.org 存储库,当我使用命令 "find-package -contains experimental" Powershell 找到了包,但是当我尝试安装它时,我收到以下错误。

install-package Microsoft.Experimental.IO -verbose
VERBOSE: Skipping package provider provider 'NuGet'-- missing required option 'Destination'
VERBOSE: Skipping package provider provider 'NuGet'-- missing required option 'Destination'
VERBOSE: The -Repository parameter was not specified.  PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2/' and PackageManagementProvider is 'NuGet'.
install-package : No match was found for the specified search criteria and package name 'Microsoft.Experimental.IO'.
At line:1 char:1
+ install-package Microsoft.Experimental.IO -verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

如何解决这个问题并安装软件包?

好吧,我使用以下命令解决了这个问题: install-package -ProviderName nuget -Name Microsoft.Experimental.IO -Destination "C:\Dev\Lib\Microsoft.Experimental.IO"

这不是最直观的,过去我在使用任何其他包管理器时都不必使用目标字段。我认为包管理器的全部意义在于对路径和位置等进行标准化...