mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
works with multiple sheets
This commit is contained in:
@@ -1,25 +1,37 @@
|
||||
"To ship, is to choose"
|
||||
# To ship, is to choose
|
||||
|
||||
ipmo .\ImportExcel.psd1 -Force
|
||||
|
||||
$file = "c:\temp\testPT.xlsx"
|
||||
rm $file -ErrorAction Ignore
|
||||
|
||||
$pt=[ordered]@{}
|
||||
|
||||
$pt.PT1=@{
|
||||
|
||||
SourceWorkSheet='Sheet1'
|
||||
PivotRows = "Status"
|
||||
PivotData= @{'Status'='count'}
|
||||
IncludePivotChart=$true
|
||||
ChartType='BarClustered3D'
|
||||
}
|
||||
|
||||
$pt.PT2=@{
|
||||
PivotRows = "StartType"
|
||||
PivotData= @{'StartType'='count'}
|
||||
SourceWorkSheet='Sheet2'
|
||||
PivotRows = "Company"
|
||||
PivotData= @{'Company'='count'}
|
||||
IncludePivotChart=$true
|
||||
ChartType='PieExploded3D'
|
||||
}
|
||||
|
||||
$gsv=Get-Service | Select-Object status, Name, displayName, starttype
|
||||
$ps=Get-Process | Select-Object Name,Company, Handles
|
||||
|
||||
$file = "c:\temp\testPT.xlsx"
|
||||
rm $file -ErrorAction Ignore
|
||||
|
||||
$gsv| Export-Excel -Path $file -AutoSize
|
||||
$ps | Export-Excel -Path $file -AutoSize -WorkSheetname Sheet2 -PivotTableDefinition $pt -Show
|
||||
|
||||
return
|
||||
Get-Service |
|
||||
select status, Name, displayName, starttype |
|
||||
Export-Excel -Path $file -Show -PivotTable $pt -AutoSize
|
||||
Export-Excel -Path $file -Show -PivotTable $pt -AutoSize
|
||||
Reference in New Issue
Block a user