mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
20 lines
582 B
PowerShell
20 lines
582 B
PowerShell
<#
|
|
.Synopsis
|
|
Chart download stats for modules/scripts published on the PowerShell Gallery
|
|
.Example
|
|
.\Get-ModuleStats.ps1 ImportExcel
|
|
#>
|
|
|
|
param(
|
|
[Parameter(Mandatory=$true)]
|
|
$moduleName,
|
|
[ValidateSet('Column','Bar','Line','Pie')]
|
|
$chartType="Line"
|
|
)
|
|
|
|
$galleryUrl = "https://www.powershellgallery.com/packages/$moduleName"
|
|
$nolegend = '-nolegend'
|
|
if($chartType -eq 'pie') {$nolegend = $null}
|
|
$code = "$($chartType)Chart (Get-HtmlTable $galleryUrl 0 | sort lastupdated -desc) -title 'Download stats for $moduleName' $nolegend"
|
|
|
|
$code | Invoke-Expression |