Skip to content

Instantly share code, notes, and snippets.

@JustinGrote
Last active November 2, 2022 20:54
Show Gist options
  • Save JustinGrote/e5252ddae829da67f4b621ad8f8f512f to your computer and use it in GitHub Desktop.
Save JustinGrote/e5252ddae829da67f4b621ad8f8f512f to your computer and use it in GitHub Desktop.
Get the latest version of all packages from a nuget feed that have dependencies
$items = 0..26 | ForEach-Object -ThrottleLimit 30 -Parallel {
$return = Invoke-RestMethod -Verbose "https://www.powershellgallery.com/api/v2/Packages()?`$filter=IsLatestVersion eq true and Dependencies%20gt%20%27a%27&`$select=Dependencies,Version,NormalizedVersion&`$orderby=Created%20desc&`$top=50000&`$skip=$($PSItem*100)"
$return | ForEach-Object {
[PSCustomObject]@{
Name = $_.title.'#text'
Dependency = $_.Properties.Dependencies
Version = $_.Properties.Version
NormalizedVersion = $_.Properties.NormalizedVersion
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment