File tree 2 files changed +26
-3
lines changed 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,10 @@ function Invoke-ScriptAnalyzer {
54
54
[switch ] $Fix ,
55
55
56
56
[Parameter (Mandatory = $false )]
57
- [switch ] $EnableExit
57
+ [switch ] $EnableExit ,
58
+
59
+ [Parameter (Mandatory = $false )]
60
+ [switch ] $ReportSummary
58
61
)
59
62
60
63
if ($null -eq $CustomRulePath )
@@ -98,6 +101,11 @@ function Invoke-ScriptAnalyzer {
98
101
}
99
102
100
103
$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
+ }
101
109
102
110
if ($EnableExit.IsPresent -and $null -ne $results )
103
111
{
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
12
12
### UNNAMED_PARAMETER_SET_1
13
13
```
14
14
Invoke-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]
16
16
[-Settings <String>]
17
17
```
18
18
19
19
### UNNAMED_PARAMETER_SET_2
20
20
```
21
21
Invoke-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]
23
23
[-Settings <String>]
24
24
```
25
25
@@ -432,6 +432,21 @@ Accept pipeline input: False
432
432
Accept wildcard characters : False
433
433
` ` `
434
434
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
+
435
450
### -Settings
436
451
File path that contains user profile or hash table for ScriptAnalyzer
437
452
You can’t perform that action at this time.
0 commit comments