File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ The PSScriptAnalyzer contains the following rule definitions.
5555| [ ReservedCmdletChar] ( ./ReservedCmdletChar.md ) | Error | Yes | |
5656| [ ReservedParams] ( ./ReservedParams.md ) | Error | Yes | |
5757| [ ReviewUnusedParameter] ( ./ReviewUnusedParameter.md ) | Warning | Yes | |
58- | [ ShouldProcess] ( ./ShouldProcess.md ) | Error | Yes | |
58+ | [ ShouldProcess] ( ./ShouldProcess.md ) | Warning | Yes | |
5959| [ UseApprovedVerbs] ( ./UseApprovedVerbs.md ) | Warning | Yes | |
6060| [ UseBOMForUnicodeEncodedFile] ( ./UseBOMForUnicodeEncodedFile.md ) | Warning | Yes | |
6161| [ UseCmdletCorrectly] ( ./UseCmdletCorrectly.md ) | Warning | Yes | |
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ title: ShouldProcess
1414If a cmdlet declares the ` SupportsShouldProcess ` attribute, then it should also call
1515` ShouldProcess ` . A violation is any function which either declares ` SupportsShouldProcess ` attribute
1616but makes no calls to ` ShouldProcess ` or it calls ` ShouldProcess ` but does not declare
17- ` SupportsShouldProcess `
17+ ` SupportsShouldProcess ` .
1818
1919For more information, see the following articles:
2020
@@ -26,7 +26,7 @@ For more information, see the following articles:
2626
2727To fix a violation of this rule, please call ` ShouldProcess ` method when a cmdlet declares
2828` SupportsShouldProcess ` attribute. Or please add ` SupportsShouldProcess ` attribute argument when
29- calling ` ShouldProcess `
29+ calling ` ShouldProcess ` .
3030
3131## Example
3232
@@ -66,10 +66,5 @@ function Set-File
6666 {
6767 $Content | Out-File -FilePath $Path
6868 }
69- else
70- {
71- # Code that should be processed if doing a WhatIf operation
72- # Must NOT change anything outside of the function / script
73- }
7469}
7570```
You can’t perform that action at this time.
0 commit comments