简体   繁体   English

如何使用 powershell 中的 nuget.exe?

[英]How to use nuget.exe from powershell?

I want to use the get-package command from powershell but everytime i try to use it or another nuget command, it brings up an error.我想使用 powershell 中的 get-package 命令,但每次我尝试使用它或另一个 nuget 命令时,都会出现错误。 How do i solve this?我该如何解决这个问题?

NuGet.exe can be downloaded from https://www.nuget.org/downloads , but that doesn't provide the PowerShell cmdlets. NuGet.exe can be downloaded from https://www.nuget.org/downloads , but that doesn't provide the PowerShell cmdlets.

As the reference docs for NuGet's PowerShell docs say:正如NuGet 的 PowerShell 文档的参考文档所说:

The commands listed here are specific to the Package Manager Console in Visual Studio, and differ from the Package Management module commands that are available in a general PowerShell environment.此处列出的命令特定于 Visual Studio 中的 Package 管理器控制台,并且不同于一般 PowerShell 环境中可用的 Package 管理模块命令。 Specifically, each environment has commands that are not available in the other, and commands with the same name may also differ in their specific arguments.具体来说,每个环境都有其他环境不可用的命令,同名的命令也可能在其具体的 arguments 上有所不同。

So, NuGet's commands like Get-Package only work in Visual Studio's Package Manager Console.因此,NuGet 的Get-Package等命令仅适用于 Visual Studio 的 Package 管理器控制台。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM