Is there a tool or script that can pull libraries and its license(s) in a single file?

Input: root source folder


Output: text file, perhaps in csv format

|       NuGet package        | Version  |  Licenses   |
| JQuery                     | 1.4      | MIT License |
| Json.NET                   | 7        | MIT License |
| ...                        | ...      | ...         |

This is as far as I could get using the Package Manager Console.

The Package Manager Console is a PowerShell console within Visual Studio used to interact with NuGet and automate Visual Studio.

The only problem is that, for what I've seen, there's no (easy) way to get the license type as you'd like, just the license URL. In any case, this gives you an idea to get started with something and might be sufficient for your purpose.

I've used the Get-Package cmdlet: open the Package Manager Console and type the following, replacing OUTPUT_CSV with the path and name of the output CSV file you want to create:

Get-Package | Select-Object Id,Version,LicenseUrl | Export-Csv OUTPUT_CSV -NoTypeInformation

I've tested it with a random project of mine, and this is the content of the output CSV file:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.