我可以从Nuget控制台获取这样的列表:
Id Installed Version Latest Version
---- ----------------- ----------------
NHibernate 3.3.0.4000 3.3.3.4001
对于解决方案中的所有项目,甚至更好?
想法?
答案 0 :(得分:8)
您可以在Package Manager控制台中将其全部粘贴为一行:
$updates = @{}; Get-Package -Updates | foreach { $updates.Add($_.Id, $_.Version) }; Get-Package | foreach { New-Object Object | Add-Member NoteProperty Name $_.Id -PassThru | Add-Member NoteProperty 'Installed Version' $_.Version -PassThru | Add-Member NoteProperty 'Latest Version' $updates.Get_Item($_.Id) -PassThru }
这将为您提供如下结果:
Name Installed Version Latest Version
---- ----------------- --------------
Antlr 3.4.1.9004 3.5.0.2
Autofac 3.2.0 3.3.0
Autofac.Mvc5 3.2.0
bootstrap 3.0.0 3.1.0
EntityFramework 6.0.0 6.0.2
jQuery 1.10.2 2.1.0
jQuery.Validation 1.11.1
Microsoft.AspNet.Identity.Core 1.0.0
Microsoft.AspNet.Identity.EntityFramework 1.0.0
Microsoft.AspNet.Identity.Owin 1.0.0
Microsoft.AspNet.Mvc 5.1.0 5.1.1
Microsoft.AspNet.Razor 3.1.0 3.1.1
Microsoft.AspNet.Web.Optimization 1.1.1 1.1.2
Microsoft.AspNet.WebApi 5.0.0 5.1.1
Microsoft.AspNet.WebApi.Client 5.0.0 5.1.1
Microsoft.AspNet.WebApi.Core 5.0.0 5.1.1
Microsoft.AspNet.WebApi.WebHost 5.0.0 5.1.1
Microsoft.AspNet.WebPages 3.1.0 3.1.1
Microsoft.jQuery.Unobtrusive.Validation 3.0.0 3.1.1
Microsoft.Owin 2.0.0 2.1.0
Microsoft.Owin.Host.SystemWeb 2.0.0 2.1.0
Microsoft.Owin.Security 2.0.0 2.1.0
Microsoft.Owin.Security.Cookies 2.0.0 2.1.0
Microsoft.Owin.Security.Facebook 2.0.0 2.1.0
Microsoft.Owin.Security.Google 2.0.0 2.1.0
Microsoft.Owin.Security.MicrosoftAccount 2.0.0 2.1.0
Microsoft.Owin.Security.OAuth 2.0.0 2.1.0
Microsoft.Owin.Security.Twitter 2.0.0 2.1.0
Microsoft.Web.Infrastructure 1.0.0.0
Modernizr 2.6.2 2.7.1
Newtonsoft.Json 5.0.6 6.0.1
Owin 1.0
RavenDB.Client 2.5.2750
Respond 1.2.0 1.3.0
WebGrease 1.5.2 1.6.0
答案 1 :(得分:1)
我稍微修改了脚本,将结果保存到名为[solution filename] .nuget.txt的解决方案文件夹中的文本文件中。这是脚本:
$updates = @{}; Get-Package -Updates | foreach { $updates.Add($_.Id, $_.Version) }; $toReview = Get-Package | foreach { New-Object Object | Add-Member NoteProperty Name $_.Id -PassThru | Add-Member NoteProperty 'Installed Version' $_.Version -PassThru | Add-Member NoteProperty 'Latest Version' $updates.Get_Item($_.Id) -PassThru } | sort -Property 'Name' -Unique | Out-File "$($dte.Solution.FileName).nuget.txt"
答案 2 :(得分:0)
获得了例外'已添加项目。输入字典”。用[Array] $ updates [$ .Id] + = $ 替换了 $ updates.Add($ .Id,$ .Version)。版本*
$updates = @{}; Get-Package -Updates | foreach { [Array]$updates[$_.Id] += $_.Version }; Get-Package | foreach { New-Object Object | Add-Member NoteProperty Name $_.Id -PassThru | Add-Member NoteProperty 'Installed Version' $_.Version -PassThru | Add-Member NoteProperty 'Latest Version' $updates.Get_Item($_.Id) -PassThru }
$updates = @{}; Get-Package -Updates | foreach {[Array]$updates[$_.Id] += $_.Version }; $toReview = Get-Package | foreach { New-Object Object | Add-Member NoteProperty Name $_.Id -PassThru | Add-Member NoteProperty 'Installed Version' $_.Version -PassThru | Add-Member NoteProperty 'Latest Version' $updates.Get_Item($_.Id) -PassThru } | sort -Property 'Name' -Unique | Out-File "$($dte.Solution.FileName).nuget.txt"