-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.psscriptanalyzer.psd1
More file actions
57 lines (41 loc) · 1.87 KB
/
.psscriptanalyzer.psd1
File metadata and controls
57 lines (41 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
@{
# Corporate runtime-safety profile (low noise)
# Baseline: PowerShell 5.1 compatible estates.
# Goal: catch high-risk patterns (security + runtime safety) without style noise.
IncludeDefaultRules = $false
# Only meaningful severities for action (keep noise down)
Severity = @('Error', 'Warning')
IncludeRules = @(
# --- Execution / injection risk ---
'PSAvoidUsingInvokeExpression',
# --- Credential / secret handling ---
'PSAvoidUsingPlainTextForPassword',
'PSAvoidUsingConvertToSecureStringWithPlainText',
'PSAvoidUsingUsernameAndPasswordParams',
# --- Reliability ---
'PSAvoidUsingEmptyCatchBlock',
# --- Operability / enterprise standards ---
'PSAvoidUsingWriteHost',
'PSAvoidUsingCmdletAliases',
# --- Safe change model ---
'PSUseShouldProcessForStateChangingFunctions',
# --- Legacy / compatibility risk ---
'PSAvoidUsingWMICmdlet'
)
Rules = @{
PSAvoidUsingInvokeExpression = @{ Enable = $true }
PSAvoidUsingPlainTextForPassword = @{ Enable = $true }
PSAvoidUsingConvertToSecureStringWithPlainText = @{ Enable = $true }
PSAvoidUsingUsernameAndPasswordParams = @{ Enable = $true }
PSAvoidUsingEmptyCatchBlock = @{ Enable = $true }
PSAvoidUsingWriteHost = @{ Enable = $true }
PSAvoidUsingCmdletAliases = @{ Enable = $true }
PSUseShouldProcessForStateChangingFunctions = @{ Enable = $true }
PSAvoidUsingWMICmdlet = @{ Enable = $true }
# Disable style noise (keep this profile safety-focused)
PSUseConsistentWhitespace = @{ Enable = $false }
PSUseConsistentIndentation = @{ Enable = $false }
# Often noisy in large corporate scripts; keep off unless you want it
PSAvoidGlobalVars = @{ Enable = $false }
}
}