Skip to content

Instantly share code, notes, and snippets.

@kort3x
Created December 3, 2019 22:21
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 kort3x/35c27389b21388292d14ea1345f802fb to your computer and use it in GitHub Desktop.
Save kort3x/35c27389b21388292d14ea1345f802fb to your computer and use it in GitHub Desktop.
choco api
$api = iwr 'https://chocolatey.org/api/v2/Search()?`$filter=IsLatestVersion&`$skip=0&`$top=30&searchTerm=%27zip%27&targetFramework=%27%27&includePrerelease=false'
[xml]$xml = $api.content
foreach ($entry in $xml.feed.entry) {
[PSCustomObject]@{
Name = $entry.title."#text"
FriendlyName = $entry.Properties.Title
Author = $entry.Author.name
Version = $entry.Properties.Version
Published = $entry.Properties.Published."#text"
Summary = $entry.summary."#text"
Description = $entry.Properties.Description
Tags = $entry.Properties.Tags."#text"
Dependencies = $entry.Properties.Dependencies
IsApproved = $entry.Properties.IsApproved
DownloadCount = $entry.Properties.DownloadCount."#text"
GalleryDetailsUrl = $entry.Properties.GalleryDetailsUrl
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment