The below PowerShell code snippet allows you to export all used Nuget packages to a text file (you can ignore the exceptions thrown because of projects without Nuget packages).
Get-Content .\[yoursolutionname].sln
| where { $_ -match "Project.+, ""(.+)\\([^\\]+).csproj"", " }
| foreach { "$($matches[1])\packages.config" } | % { Get-Content $_ | Find "<package id" } | Sort-Object -Unique | Out-File -FilePath c:\temp\packages_demo
No comments:
Post a Comment