From 118330ea479532c87a05dff6448da00019a88a75 Mon Sep 17 00:00:00 2001 From: jhoneill Date: Sun, 22 Dec 2019 16:39:38 +0000 Subject: [PATCH] Make primary name "PivotTableChartType" (with alias chartType) in Export-Excel --- Public/Export-Excel.ps1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Public/Export-Excel.ps1 b/Public/Export-Excel.ps1 index b1653ae..5900aac 100644 --- a/Public/Export-Excel.ps1 +++ b/Public/Export-Excel.ps1 @@ -22,6 +22,7 @@ [Switch]$TitleBold, [Int]$TitleSize = 22, $TitleBackgroundColor, + [parameter(DontShow=$true)] [Switch]$IncludePivotTable, [String]$PivotTableName, [String[]]$PivotRows, @@ -31,7 +32,8 @@ [Switch]$PivotDataToColumn, [Hashtable]$PivotTableDefinition, [Switch]$IncludePivotChart, - [OfficeOpenXml.Drawing.Chart.eChartType]$ChartType = 'Pie', + [Alias('ChartType')] + [OfficeOpenXml.Drawing.Chart.eChartType]$PivotChartType = 'Pie', [Switch]$NoLegend, [Switch]$ShowCategory, [Switch]$ShowPercent, @@ -462,9 +464,9 @@ Elseif ($PivotTotals) {$params.PivotTotals = $PivotTotals} if ($PivotDataToColumn) {$params.PivotDataToColumn = $true} if ($IncludePivotChart -or - $PSBoundParameters.ContainsKey('ChartType')) { + $PSBoundParameters.ContainsKey('PivotChartType')) { $params.IncludePivotChart = $true - $Params.ChartType = $ChartType + $Params.ChartType = $PivotChartType if ($ShowCategory) {$params.ShowCategory = $true} if ($ShowPercent) {$params.ShowPercent = $true} if ($NoLegend) {$params.NoLegend = $true}