-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPSScriptAnalyzerSettings.psd1
More file actions
20 lines (20 loc) · 1.16 KB
/
Copy pathPSScriptAnalyzerSettings.psd1
File metadata and controls
20 lines (20 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
@{
ExcludeRules = @(
# WPF event handlers assign $_ and other automatic variables in closures
'PSAvoidAssignmentToAutomaticVariable',
# No Write-Host in production but may appear in debugging helpers
'PSAvoidUsingWriteHost',
# Runspace scriptblocks reference outer-scope parameters by design
'PSReviewUnusedParameter',
# Normalize-*, Toggle-*, Apply-* are internal; script does not export modules
'PSUseApprovedVerbs',
# Script-scope state variables ($script:Foo = $null) are assigned once and used later
'PSUseDeclaredVarsMoreThanAssignments',
# 35+ GUI functions (Set-*, Save-*, Invoke-*) mutate adapter/DNS/profile state through WPF buttons, not interactive CLI; ShouldProcess is inappropriate
'PSUseShouldProcessForStateChangingFunctions',
# Internal function names use plural nouns for collections
'PSUseSingularNouns',
# Runspace scriptblocks ($ps.AddScript) intentionally capture outer-scope variables via closure; $using: is only valid in PS remoting/Start-Job, not [PowerShell]::Create() runspaces
'PSUseUsingScopeModifierInNewRunspaces'
)
}