Skip to content

Instantly share code, notes, and snippets.

@dfinke
Created January 29, 2016 19:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dfinke/43b053776b8047618717 to your computer and use it in GitHub Desktop.
Save dfinke/43b053776b8047618717 to your computer and use it in GitHub Desktop.
Get statistics for published PowerShell Gallery packages
function Get-PSGalleryInfo {
param(
[Parameter(ValueFromPipelineByPropertyName=$true)]
$Name
)
Begin {
$t = @"
{Name*:PowerShellISE-preview} {[version]Version:5.1.0.1} (this version) {[double]Downloads:885} {[DateTime]PublishDate:Wednesday, January 27 2016}
{Name*:ImportExcel} 1.97 {Downloads:106} Monday, January 18 2016
"@
}
Process {
$url ="https://www.powershellgallery.com/packages/$Name/"
$r=iwr $url
($r.AllElements | ? {$_.class -match 'versionTableRow'}).innertext |
ConvertFrom-String -TemplateContent $t
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment