如何使用 Nuget 控制台获取 jQuery 版本列表? [英] How can I get a list of versions of jQuery using the Nuget console?
问题描述
我正在尝试找出解决我遇到的问题的解决方法,jQuery 2.0 是 Nuget 希望通过 GUI 更新到的版本(我可以将 Nuget 保留在 jQuery 1.9.x/1.x 路径上吗(而不是升级到 2.x)?).
I'm trying to figure out a workaround for an issue I have with jQuery 2.0 being the version Nuget wants to update to via the GUI (Can I keep Nuget on the jQuery 1.9.x/1.x path (instead of upgrading to 2.x)?).
查看 this answer 另一个问题,看来我应该能够使用 Nuget 控制台获取所有版本jQuery的:
Looking at this answer to another question it appears that I should be able to use the Nuget console to get all versions of jQuery:
Get-Package -ListAvailable -Filter 'jQuery' -AllVersions
然后我应该能够选择我想要的版本并更新它:
Then I should be able to pick the version I want and update it:
Install-Package jQuery -Version 1.9.1
或
Update-Package jQuery -Version 1.9.1
不幸的是,虽然更新工作完美,但试图获取 jQuery 版本列表最终会抓住许多仅在其标题中引用或包含 jQuery 的项目.
Unfortunately, while updating works perfectly, trying to get a list of jQuery versions ends up grabbing numerous projects that merely refer to or contain jQuery in their title.
我想我可以使用 Open-PackagePage
,但这看起来很笨拙.
I suppose I could use Open-PackagePage
, but that seems klunky.
但是,我没有看到任何参数表明我可以在 官方文档.
However, I don't see any parameters that suggest I can filter by Id in the official docs.
有没有办法限制 Nuget 控制台仅按项目 ID 进行搜索?或者是否有其他方法可以使用 Nuget 控制台获取 jQuery 版本列表?我试过在我的 jQuery 过滤器 (-filter 'jQuery'
) 周围加上引号,但这也没有解决问题.
Is there a way to restrict the Nuget console to search only by project Id? Or is there some other way I can get a listing of versions of jQuery using the Nuget console? I've tried quotes around my jQuery filter (-filter 'jQuery'
) but that didn't resolve the issue either.
推荐答案
输入 Install-Package JQuery -Version
然后 Space,然后 Tab.
Type Install-Package JQuery -Version
then Space, then Tab.
这会显示该软件包的所有可用版本的列表.
This displays a list of all available versions for that package.
Get-Package
及其 -Filter
选项的问题在于它搜索 ID
和 Description
字段.我同意如果有 -ID
选项或类似的选项会非常有用.
The problem with Get-Package
and its -Filter
option is that it does a search of both ID
and Description
fields. I agree that it would be very useful if there was an -ID
option or similar.
这篇关于如何使用 Nuget 控制台获取 jQuery 版本列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!