From 3b69c88474d94219c2ae1674a42bd33d737eadfd Mon Sep 17 00:00:00 2001 From: dfinke Date: Tue, 22 Mar 2016 09:28:57 -0400 Subject: [PATCH] Add chart stats for ps gallery module --- Examples/Extra/Get-ModuleStats.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Examples/Extra/Get-ModuleStats.ps1 diff --git a/Examples/Extra/Get-ModuleStats.ps1 b/Examples/Extra/Get-ModuleStats.ps1 new file mode 100644 index 0000000..1a08faf --- /dev/null +++ b/Examples/Extra/Get-ModuleStats.ps1 @@ -0,0 +1,13 @@ +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) -title 'Download stats for $moduleName' $nolegend" + +$code | Invoke-Expression \ No newline at end of file