mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
25 lines
483 B
PowerShell
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 |