|
| 1 | +# Use the PowerShell extension setting `powershell.scriptAnalysis.settingsPath` to get the current workspace |
| 2 | +# to use this PSScriptAnalyzerSettings.psd1 file to configure code analysis in Visual Studio Code. |
| 3 | +# This setting is configured in the workspace's `.vscode\settings.json`. |
| 4 | +# |
| 5 | +# For more information on PSScriptAnalyzer settings see: |
| 6 | +# https://github.com/PowerShell/PSScriptAnalyzer/blob/master/README.md#settings-support-in-scriptanalyzer |
| 7 | +# |
| 8 | +# You can see the predefined PSScriptAnalyzer settings here: |
| 9 | +# https://github.com/PowerShell/PSScriptAnalyzer/tree/master/Engine/Settings |
| 10 | +@{ |
| 11 | + # Only diagnostic records of the specified severity will be generated. |
| 12 | + # Uncomment the following line if you only want Errors and Warnings but |
| 13 | + # not Information diagnostic records. |
| 14 | + #Severity = @('Error','Warning') |
| 15 | + |
| 16 | + # Analyze **only** the following rules. Use IncludeRules when you want |
| 17 | + # to invoke only a small subset of the default rules. |
| 18 | + IncludeRules = @('PSAvoidDefaultValueSwitchParameter', |
| 19 | + 'PSMisleadingBacktick', |
| 20 | + 'PSMissingModuleManifestField', |
| 21 | + 'PSReservedCmdletChar', |
| 22 | + 'PSReservedParams', |
| 23 | + 'PSShouldProcess', |
| 24 | + 'PSUseApprovedVerbs', |
| 25 | + 'PSAvoidUsingCmdletAliases', |
| 26 | + 'PSUseDeclaredVarsMoreThanAssignments') |
| 27 | + |
| 28 | + # Do not analyze the following rules. Use ExcludeRules when you have |
| 29 | + # commented out the IncludeRules settings above and want to include all |
| 30 | + # the default rules except for those you exclude below. |
| 31 | + # Note: if a rule is in both IncludeRules and ExcludeRules, the rule |
| 32 | + # will be excluded. |
| 33 | + #ExcludeRules = @('PSAvoidUsingWriteHost') |
| 34 | + |
| 35 | + # You can use rule configuration to configure rules that support it: |
| 36 | + Rules = @{ |
| 37 | + PSAvoidUsingCmdletAliases = @{ |
| 38 | + Whitelist = @("Task") |
| 39 | + } |
| 40 | + } |
| 41 | +} |
0 commit comments