Files
ImportExcel/Examples/TryMultiplePivotTables.ps1
2017-10-12 10:55:18 -04:00

25 lines
483 B
PowerShell

"To ship, is to choose"
ipmo .\ImportExcel.psd1 -Force
$file = "c:\temp\testPT.xlsx"
rm $file -ErrorAction Ignore
$pt=[ordered]@{}
$pt.PT1=@{
PivotRows = "Status"
PivotData= @{'Status'='count'}
IncludePivotChart=$true
}
$pt.PT2=@{
PivotRows = "StartType"
PivotData= @{'StartType'='count'}
IncludePivotChart=$true
}
Get-Service |
select status, Name, displayName, starttype |
Export-Excel -Path $file -Show -PivotTable $pt -AutoSize