Files
ImportExcel/Examples/Extra/Get-ModuleStats.ps1
dfinke a436daea7d Added
2016-03-22 23:41:39 -04:00

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