mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
25 lines
722 B
PowerShell
25 lines
722 B
PowerShell
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
|
|
|
|
$ExcelParams = @{
|
|
Path = "$env:TEMP\test1.xlsx"
|
|
IncludePivotTable = $true
|
|
PivotRows = 'Company'
|
|
PivotTableName = 'MyTable'
|
|
PivotData = @{'Handles' = 'sum'}
|
|
Show = $true
|
|
Activate = $true
|
|
}
|
|
Remove-Item $ExcelParams.Path -ErrorAction Ignore
|
|
Get-Process | Select-Object Company, Handles | Export-Excel @ExcelParams
|
|
|
|
<# Builds a pivot table that looks like this:
|
|
|
|
Sum of Handles
|
|
Row Labels Total
|
|
Adobe Systems Incorporated 3100
|
|
(blank) 214374
|
|
Apple Inc. 215
|
|
etc
|
|
etc
|
|
Grand Total 365625
|
|
#> |