2014-02-18 46 views

回答

6

你可以粘貼在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   
+0

真的很好,謝謝! –

+0

不錯的工作...........有時我喜歡nuget,有時候我渴望Apache Ivy(獨立)。 – granadaCoder

0

我修改劇本稍微保存結果到解決方案文件夾中的一個名爲[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"