This commit is contained in:
dfinke
2017-10-13 15:50:25 -04:00
parent ceb986b408
commit 8d6f5521af
2 changed files with 39 additions and 14 deletions

View File

@@ -1,19 +1,26 @@
$file="C:\Temp\test.xlsx"
Import-Module ..\ImportExcel.psd1 -Force
rm $file -ErrorAction Ignore -Force
$file = "C:\Temp\test.xlsx"
Remove-Item $file -ErrorAction Ignore -Force
$ptd = @{}
$base=@{
SourceWorkSheet='gsv'
PivotData= @{'Status'='count'}
IncludePivotChart=$true
ChartType='BarClustered3D'
$base = @{
SourceWorkSheet = 'gsv'
PivotData = @{'Status' = 'count'}
IncludePivotChart = $true
# ChartType = 'BarClustered3D'
}
$ptd.gpt1 = $base + @{ PivotRows = "ServiceType" }
$ptd.gpt2 = $base + @{ PivotRows = "Status" }
$ptd.gpt3 = $base + @{ PivotRows = "StartType" }
$ptd.gpt4 = $base + @{ PivotRows = "CanStop" }
$ptd = [ordered]@{}
gsv | Export-Excel -path $file -WorkSheetname gsv -Show -PivotTableDefinition $ptd
# $ptd.gpt1 = $base + @{ PivotRows = "ServiceType" }
# $ptd.gpt2 = $base + @{ PivotRows = "Status" }
# $ptd.gpt3 = $base + @{ PivotRows = "StartType" }
# $ptd.gpt4 = $base + @{ PivotRows = "CanStop" }
$ptd += New-PivotTableDefinition @base servicetype -PivotRows servicetype -ChartType Area3D
$ptd += New-PivotTableDefinition @base status -PivotRows status -ChartType PieExploded3D
$ptd += New-PivotTableDefinition @base starttype -PivotRows starttype -ChartType BarClustered3D
$ptd += New-PivotTableDefinition @base canstop -PivotRows canstop -ChartType ConeColStacked
Get-Service | Export-Excel -path $file -WorkSheetname gsv -Show -PivotTableDefinition $ptd