From 3ec2481750cdb5d771812c9de2a72dae723eb1fe Mon Sep 17 00:00:00 2001 From: dfinke Date: Mon, 6 May 2019 12:14:33 -0400 Subject: [PATCH] Added Pivoting Pester Test Results --- .../Pester/Analyze_that.ps1 | 26 +++++++++++++++++++ .../ScriptAnalyzer/Analyze_this.ps1 | 0 2 files changed, 26 insertions(+) create mode 100644 Examples/InteractWithOtherModules/Pester/Analyze_that.ps1 rename Examples/{ => InteractWithOtherModules}/ScriptAnalyzer/Analyze_this.ps1 (100%) diff --git a/Examples/InteractWithOtherModules/Pester/Analyze_that.ps1 b/Examples/InteractWithOtherModules/Pester/Analyze_that.ps1 new file mode 100644 index 0000000..69e4659 --- /dev/null +++ b/Examples/InteractWithOtherModules/Pester/Analyze_that.ps1 @@ -0,0 +1,26 @@ +param( + $PesterTestsPath = "$PSScriptRoot\..\..\..\__tests__\" +) + +$xlfile = "$env:Temp\testResults.xlsx" +Remove-Item $xlfile -ErrorAction SilentlyContinue + +$xlparams = @{ + Path = $xlfile + InputObject = (Invoke-Pester -Script $PesterTestsPath -PassThru).TestResult | Sort-Object describe + WorksheetName = 'FullResults' + + IncludePivotTable = $true + PivotRows = 'Describe' + PivotColumns = 'Passed' + PivotData = @{'Passed' = 'Count' } + + IncludePivotChart = $true + ChartType = 'BarClustered' + + AutoSize = $true + AutoFilter = $true + Activate = $true +} + +Export-Excel -Show @xlparams \ No newline at end of file diff --git a/Examples/ScriptAnalyzer/Analyze_this.ps1 b/Examples/InteractWithOtherModules/ScriptAnalyzer/Analyze_this.ps1 similarity index 100% rename from Examples/ScriptAnalyzer/Analyze_this.ps1 rename to Examples/InteractWithOtherModules/ScriptAnalyzer/Analyze_this.ps1