File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,10 @@ function Invoke-ScriptAnalyzer {
5454 [switch ] $Fix ,
5555
5656 [Parameter (Mandatory = $false )]
57- [switch ] $EnableExit
57+ [switch ] $EnableExit ,
58+
59+ [Parameter (Mandatory = $false )]
60+ [switch ] $ReportSummary
5861 )
5962
6063 if ($null -eq $CustomRulePath )
@@ -98,6 +101,11 @@ function Invoke-ScriptAnalyzer {
98101 }
99102
100103 $results
104+
105+ if ($ReportSummary.IsPresent -and $null -ne $results )
106+ {
107+ Write-Host " Found $results .Count warnings" # This is not the exact message that it would print but close enough
108+ }
101109
102110 if ($EnableExit.IsPresent -and $null -ne $results )
103111 {
Original file line number Diff line number Diff line change @@ -12,14 +12,14 @@ Evaluates a script or module based on selected best practice rules
1212### UNNAMED_PARAMETER_SET_1
1313```
1414Invoke-ScriptAnalyzer [-Path] <String> [-CustomRulePath <String>] [-RecurseCustomRulePath]
15- [-ExcludeRule <String[]>] [-IncludeRule <String[]>] [-Severity <String[]>] [-Recurse] [-SuppressedOnly] [-Fix] [-EnableExit]
15+ [-ExcludeRule <String[]>] [-IncludeRule <String[]>] [-Severity <String[]>] [-Recurse] [-SuppressedOnly] [-Fix] [-EnableExit] [-ReportSummary]
1616 [-Settings <String>]
1717```
1818
1919### UNNAMED_PARAMETER_SET_2
2020```
2121Invoke-ScriptAnalyzer [-ScriptDefinition] <String> [-CustomRulePath <String>] [-RecurseCustomRulePath]
22- [-ExcludeRule <String[]>] [-IncludeRule <String[]>] [-Severity <String[]>] [-Recurse] [-SuppressedOnly] [-EnableExit]
22+ [-ExcludeRule <String[]>] [-IncludeRule <String[]>] [-Severity <String[]>] [-Recurse] [-SuppressedOnly] [-EnableExit] [-ReportSummary]
2323 [-Settings <String>]
2424```
2525
@@ -432,6 +432,21 @@ Accept pipeline input: False
432432Accept wildcard characters : False
433433` ` `
434434
435+ ### -ReportSummary
436+ Writes a report summary of the found warnings to the host.
437+
438+ ` ` ` yaml
439+ Type : SwitchParameter
440+ Parameter Sets : (All)
441+ Aliases :
442+
443+ Required : False
444+ Position : Named
445+ Default value : False
446+ Accept pipeline input : False
447+ Accept wildcard characters : False
448+ ` ` `
449+
435450### -Settings
436451File path that contains user profile or hash table for ScriptAnalyzer
437452
You can’t perform that action at this time.
0 commit comments