Skip to content

Instantly share code, notes, and snippets.

@BlueBasher
Forked from haacked/download-nuget-licenses.ps1
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BlueBasher/d3b960957ecfc2f153a9 to your computer and use it in GitHub Desktop.
Save BlueBasher/d3b960957ecfc2f153a9 to your computer and use it in GitHub Desktop.
@( Get-Project -All | ? { $_.ProjectName } | % { Get-Package -ProjectName $_.ProjectName } ) | Sort -Unique | % { $pkg = $_ ; Try { (New-Object System.Net.WebClient).DownloadFile($pkg.LicenseUrl, 'C:\Development\licenses\' + $pkg.Id + ".html") } Catch [system.exception] { Write-Host "Could not download license for $pkg" + $_.Exception.Message} }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment