Skip to content

Commit dc4ec54

Browse files
committed
Resolve PoliCheck issue
Turns out PSScriptAnalyzer now allows for `AllowList` instead.
1 parent 130295f commit dc4ec54

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4641,7 +4641,7 @@ for more details on how it can be used and how you can create your own templates
46414641
The PowerShell extension now uses any "suggested corrections" which are returned with
46424642
a rule violation in your script file to provide a "quick fix" option for the affected
46434643
section of code. For example, when the `PSAvoidUsingCmdletAliases` rule finds the use
4644-
of a non-whitelisted alias, you will see a light bulb icon that gives the option to
4644+
of a non-allowlisted alias, you will see a light bulb icon that gives the option to
46454645
change to the full name (right click or <kbd>Ctrl+.</kbd> on the marker):
46464646

46474647
![Screenshot of PSScriptAnalyzer quick fix](https://cloud.githubusercontent.com/assets/79405/21247558/05887e86-c2e5-11e6-9c67-e4558a7e2dba.png)

examples/PSScriptAnalyzerSettings.psd1

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Use the PowerShell extension setting `powershell.scriptAnalysis.settingsPath` to get the current workspace
22
# 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`.
3+
# This setting is configured in the workspace's `.vscode/settings.json`.
44
#
55
# For more information on PSScriptAnalyzer settings see:
66
# https://github.com/PowerShell/PSScriptAnalyzer/blob/master/README.md#settings-support-in-scriptanalyzer
@@ -11,7 +11,8 @@
1111
# Only diagnostic records of the specified severity will be generated.
1212
# Uncomment the following line if you only want Errors and Warnings but
1313
# not Information diagnostic records.
14-
#Severity = @('Error','Warning')
14+
#
15+
# Severity = @('Error', 'Warning')
1516

1617
# Analyze **only** the following rules. Use IncludeRules when you want
1718
# to invoke only a small subset of the default rules.
@@ -28,14 +29,16 @@
2829
# Do not analyze the following rules. Use ExcludeRules when you have
2930
# commented out the IncludeRules settings above and want to include all
3031
# the default rules except for those you exclude below.
31-
# Note: if a rule is in both IncludeRules and ExcludeRules, the rule
32+
# Note that if a rule is in both IncludeRules and ExcludeRules, the rule
3233
# will be excluded.
33-
#ExcludeRules = @('PSAvoidUsingWriteHost')
34+
#
35+
# ExcludeRules = @('PSAvoidUsingWriteHost')
3436

3537
# You can use rule configuration to configure rules that support it:
36-
#Rules = @{
37-
# PSAvoidUsingCmdletAliases = @{
38-
# Whitelist = @("cd")
39-
# }
40-
#}
38+
#
39+
# Rules = @{
40+
# PSAvoidUsingCmdletAliases = @{
41+
# AllowList = @("cd")
42+
# }
43+
# }
4144
}

0 commit comments

Comments
 (0)