mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-23 19:53:58 +00:00
Example : Analyze_this
This commit is contained in:
@@ -1,6 +1,17 @@
|
|||||||
<#
|
<#
|
||||||
.Synopsis
|
.Synopsis
|
||||||
|
Runs PsScriptAnalyzer against one or more folders and pivots the results to form a report.
|
||||||
|
|
||||||
|
.Example
|
||||||
|
Analyze_this.ps1
|
||||||
|
Invokes script analyzer on the current directory; creates a file in $env:temp and opens it in Excel
|
||||||
|
.Example
|
||||||
|
Analyze_this.ps1 -xlfile ..\mymodule.xlsx -quiet
|
||||||
|
Invokes script analyzer on the current directory; creates a file in the parent directory but does not open it
|
||||||
|
.Example
|
||||||
|
"." , (dir 'C:\Program Files\WindowsPowerShell\Modules\ImportExcel\') | .\examples\ScriptAnalyzer\Analyze_this.ps1
|
||||||
|
run from a developemnt directory for importExcel it will produce a report for that directory compared against installed versions
|
||||||
|
this creates the file in the default location and opens it
|
||||||
#>
|
#>
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
param (
|
param (
|
||||||
@@ -8,6 +19,7 @@ param (
|
|||||||
$Path = $PWD,
|
$Path = $PWD,
|
||||||
$xlfile = "$env:TEMP\ScriptAnalyzer.xlsx",
|
$xlfile = "$env:TEMP\ScriptAnalyzer.xlsx",
|
||||||
$ChartType = 'BarClustered' ,
|
$ChartType = 'BarClustered' ,
|
||||||
|
$PivotColumns = 'Location',
|
||||||
[switch]$Quiet
|
[switch]$Quiet
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -37,7 +49,7 @@ process {
|
|||||||
}
|
}
|
||||||
|
|
||||||
end {
|
end {
|
||||||
$pivotParams['-PivotChartDefinition'] = New-ExcelChartDefinition -ChartType $chartType -Column $dirsToProcess.Count -Title "Script analysis" -LegendBold
|
$pivotParams['-PivotChartDefinition'] = New-ExcelChartDefinition -ChartType $chartType -Column (1 + $dirsToProcess.Count) -Title "Script analysis" -LegendBold
|
||||||
$xlparams['PivotTableDefinition'] = New-PivotTableDefinition @pivotParams
|
$xlparams['PivotTableDefinition'] = New-PivotTableDefinition @pivotParams
|
||||||
|
|
||||||
$dirsToProcess | ForEach-Object {
|
$dirsToProcess | ForEach-Object {
|
||||||
|
|||||||
Reference in New Issue
Block a user