Skip to content

Commit d04a046

Browse files
author
Kapil Borle
committed
Add missing help to cmdlet help files
1 parent 173333d commit d04a046

File tree

2 files changed

+66
-34
lines changed

2 files changed

+66
-34
lines changed

docs/markdown/Get-ScriptAnalyzerRule.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ Enter the path to a .NET assembly or module that contains Script Analyzer rules.
8484
You can enter only one value, but wildcards are supported.
8585
To get rules in subdirectories of the path, use the RecurseCustomRulePath parameter.
8686

87-
You can create custom rules by using a custom .NET assembly or a Windows PowerShell module, such as the Community Analyzer Rules in
87+
You can create custom rules by using a custom .NET assembly or a Windows PowerShell module, such as the Community Analyzer Rules in
8888
https://github.com/PowerShell/PSScriptAnalyzer/blob/development/Tests/Engine/CommunityAnalyzerRules/CommunityAnalyzerRules.psm1.
8989

9090
```yaml
91-
Type: String
91+
Type: String[]
9292
Parameter Sets: (All)
9393
Aliases: CustomizedRulePath
9494

@@ -106,11 +106,11 @@ By default, Get-ScriptAnalyzerRule adds only the custom rules in the specified p
106106
```yaml
107107
Type: SwitchParameter
108108
Parameter Sets: (All)
109-
Aliases:
109+
Aliases:
110110

111111
Required: False
112112
Position: Named
113-
Default value:
113+
Default value:
114114
Accept pipeline input: False
115115
Accept wildcard characters: False
116116
```
@@ -125,7 +125,7 @@ By default, Get-ScriptAnalyzerRule gets all rules.
125125
```yaml
126126
Type: String[]
127127
Parameter Sets: (All)
128-
Aliases:
128+
Aliases:
129129

130130
Required: False
131131
Position: Named
@@ -142,7 +142,7 @@ By default, Get-ScriptAnalyzerRule gets all rules.
142142
```yaml
143143
Type: String[]
144144
Parameter Sets: (All)
145-
Aliases:
145+
Aliases:
146146

147147
Required: False
148148
Position: Named

docs/markdown/Invoke-ScriptAnalyzer.md

Lines changed: 60 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ Evaluates a script or module based on selected best practice rules
1414
```
1515
Invoke-ScriptAnalyzer [-Path] <String> [-CustomRulePath <String>] [-RecurseCustomRulePath]
1616
[-ExcludeRule <String[]>] [-IncludeRule <String[]>] [-Severity <String[]>] [-Recurse] [-SuppressedOnly]
17-
[-Profile <String>]
17+
[-Settings <String>]
1818
```
1919

2020
### UNNAMED_PARAMETER_SET_2
2121
```
2222
Invoke-ScriptAnalyzer [-ScriptDefinition] <String> [-CustomRulePath <String>] [-RecurseCustomRulePath]
2323
[-ExcludeRule <String[]>] [-IncludeRule <String[]>] [-Severity <String[]>] [-Recurse] [-SuppressedOnly]
24-
[-Profile <String>]
24+
[-Settings <String>]
2525
```
2626

2727
## DESCRIPTION
@@ -118,7 +118,7 @@ function Get-Widgets
118118
Param()
119119
120120
dir $pshome
121-
...
121+
...
122122
}
123123
124124
PS C:\> Invoke-ScriptAnalyzer -Path .\Get-Widgets.ps1
@@ -192,7 +192,7 @@ PSUseSingularNouns Warning 1 The cmd
192192
```
193193

194194
This command uses the ScriptDefinition parameter to analyze a function at the command line.
195-
The function string is enclosed in quotation marks.
195+
The function string is enclosed in quotation marks.
196196

197197
When you use the ScriptDefinition parameter, the FileName property of the DiagnosticRecord object is $null.
198198

@@ -215,13 +215,13 @@ Aliases: PSPath
215215

216216
Required: True
217217
Position: 0
218-
Default value:
218+
Default value:
219219
Accept pipeline input: False
220220
Accept wildcard characters: False
221221
```
222222
223223
### -CustomRulePath
224-
Adds the custom rules defined in the specified paths to the analysis.
224+
Adds the custom rules defined in the specified paths to the analysis.
225225
226226
Enter the path to a file that defines rules or a directory that contains files that define rules.
227227
Wildcard characters are supported.
@@ -232,29 +232,29 @@ By default, Invoke-ScriptAnalyzer uses only rules defined in the Microsoft.Windo
232232
If Invoke-ScriptAnalyzer cannot find rules in the CustomRulePath, it runs the standard rules without notice.
233233
234234
```yaml
235-
Type: String
235+
Type: String[]
236236
Parameter Sets: (All)
237237
Aliases: CustomizedRulePath
238238

239239
Required: False
240240
Position: Named
241-
Default value:
241+
Default value:
242242
Accept pipeline input: False
243243
Accept wildcard characters: False
244244
```
245245
246246
### -RecurseCustomRulePath
247-
Adds rules defined in in subdirectories of the CustomRulePath location.
247+
Adds rules defined in subdirectories of the CustomRulePath location.
248248
By default, Invoke-ScriptAnalyzer adds only the custom rules defined in the specified file or directory.
249249
250250
```yaml
251251
Type: SwitchParameter
252252
Parameter Sets: (All)
253-
Aliases:
253+
Aliases:
254254

255255
Required: False
256256
Position: Named
257-
Default value:
257+
Default value:
258258
Accept pipeline input: False
259259
Accept wildcard characters: False
260260
```
@@ -280,7 +280,7 @@ If a rule is specified in both the ExcludeRule and IncludeRule collections, the
280280
```yaml
281281
Type: String[]
282282
Parameter Sets: (All)
283-
Aliases:
283+
Aliases:
284284

285285
Required: False
286286
Position: Named
@@ -289,6 +289,22 @@ Accept pipeline input: False
289289
Accept wildcard characters: False
290290
```
291291
292+
### -IncludeDefaultRules
293+
Invoke default rules along with Custom rules
294+
295+
```yaml
296+
Type: SwitchParameter
297+
Parameter Sets: (All)
298+
Aliases:
299+
300+
Required: False
301+
Position: Named
302+
Default value: False
303+
Accept pipeline input: False
304+
Accept wildcard characters: False
305+
```
306+
307+
292308
### -IncludeRule
293309
Runs only the specified rules in the Script Analyzer test.
294310
By default, PSScriptAnalyzer runs all rules.
@@ -309,7 +325,7 @@ include a Warning rule.
309325
```yaml
310326
Type: String[]
311327
Parameter Sets: (All)
312-
Aliases:
328+
Aliases:
313329

314330
Required: False
315331
Position: Named
@@ -336,7 +352,7 @@ include a Warning rule.
336352
```yaml
337353
Type: String[]
338354
Parameter Sets: (All)
339-
Aliases:
355+
Aliases:
340356

341357
Required: False
342358
Position: Named
@@ -354,7 +370,7 @@ To search the CustomRulePath recursively, use the RecurseCustomRulePath paramete
354370
```yaml
355371
Type: SwitchParameter
356372
Parameter Sets: (All)
357-
Aliases:
373+
Aliases:
358374

359375
Required: False
360376
Position: Named
@@ -375,7 +391,7 @@ For help, see the examples.
375391
```yaml
376392
Type: SwitchParameter
377393
Parameter Sets: (All)
378-
Aliases:
394+
Aliases:
379395

380396
Required: False
381397
Position: Named
@@ -384,14 +400,12 @@ Accept pipeline input: False
384400
Accept wildcard characters: False
385401
```
386402
387-
### -Profile
388-
Runs Invoke-ScriptAnalyzer with the parameters and values specified in a Script Analyzer profile file.
389-
Enter the path
390-
to the profile file.
403+
### -Settings
404+
File path that contains user profile or hash table for ScriptAnalyzer
405+
406+
Runs Invoke-ScriptAnalyzer with the parameters and values specified in a Script Analyzer profile file or hash table
391407
392-
If the path, the file, or its content is invalid, it is ignored.
393-
The parameters and values in the profile take
394-
precedence over the same parameter and values specified at the command line.
408+
If the path, the file's or hashtable's content are invalid, it is ignored. The parameters and values in the profile take precedence over the same parameter and values specified at the command line.
395409
396410
A Script Analyzer profile file is a text file that contains a hash table with one or more of the following keys:
397411
-- Severity
@@ -411,13 +425,13 @@ For example:
411425
@{ Severity = 'Error', 'Warning'}
412426
413427
```yaml
414-
Type: String
428+
Type: Object
415429
Parameter Sets: (All)
416-
Aliases:
430+
Aliases: Profile
417431

418432
Required: False
419433
Position: Named
420-
Default value: Uses the parameters and values specified at the command line.
434+
Default value:
421435
Accept pipeline input: False
422436
Accept wildcard characters: False
423437
```
@@ -431,15 +445,33 @@ Unlike ScriptBlock parameters, the ScriptDefinition parameter requires a string
431445
```yaml
432446
Type: String
433447
Parameter Sets: UNNAMED_PARAMETER_SET_2
434-
Aliases:
448+
Aliases:
435449

436450
Required: True
437451
Position: 0
438-
Default value:
452+
Default value:
439453
Accept pipeline input: False
440454
Accept wildcard characters: False
441455
```
442456
457+
### -SaveDscDependency
458+
Resolve DSC resource dependency
459+
460+
Whenever Invoke-ScriptAnalyzer (isa) is run on a script having the dynamic keyword "Import-DSCResource -ModuleName <somemodule>", if <somemodule> is not present in any of the PSModulePath, isa gives parse error. This error is caused by the powershell parser not being able to find the symbol for <somemodule>. If isa finds the module on PowerShell Gallery (www.powershellgallery.com) then it downloads the missing module to a temp path. The temp path is then added to PSModulePath only for duration of the scan. The temp location can be found in $LOCALAPPDATA/PSScriptAnalyzer/TempModuleDir.
461+
462+
```yaml
463+
Type: SwitchParameter
464+
Parameter Sets: (All)
465+
Aliases:
466+
467+
Required: False
468+
Position: Named
469+
Default value: False
470+
Accept pipeline input: False
471+
Accept wildcard characters: False
472+
```
473+
474+
443475
## INPUTS
444476
445477
### None

0 commit comments

Comments
 (0)