mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
21 lines
547 B
PowerShell
21 lines
547 B
PowerShell
function Pivot {
|
|
[CmdletBinding()]
|
|
param(
|
|
$targetData,
|
|
$pivotRows,
|
|
$pivotData,
|
|
[OfficeOpenXml.Drawing.Chart.eChartType]$ChartType="Pie"
|
|
)
|
|
|
|
if(!$pivotData) {$pivotData=$pivotRows}
|
|
|
|
$xlFile = [System.IO.Path]::GetTempFileName() -replace "tmp","xlsx"
|
|
Write-Verbose $xlFile
|
|
|
|
$targetData |
|
|
Export-Excel -Path $xlFile `
|
|
-IncludePivotTable -IncludePivotChart `
|
|
-PivotRows $pivotRows -PivotData $pivotData `
|
|
-ChartType $ChartType `
|
|
-Show
|
|
} |