|
10 | 10 | Whitelist = @('task') |
11 | 11 | } |
12 | 12 |
|
13 | | - # Cross-version compatibility guardrails. PowerShellBuild still supports |
14 | | - # Windows PowerShell 5.1 (Desktop) per the manifest, so these rules flag any |
15 | | - # syntax, command, or type that would not work on the lowest supported engine. |
16 | | - # PSUseCompatibleSyntax checks against the target language versions regardless |
17 | | - # of the engine the analyzer runs under, so a PowerShell 7+-only construct (for |
18 | | - # example the ternary operator) is caught even when the analyzer runs from pwsh. |
| 13 | + # Cross-version compatibility guardrail. PowerShellBuild still supports Windows |
| 14 | + # PowerShell 5.1 (Desktop) per the manifest, so this flags syntax that would not |
| 15 | + # parse on the lowest supported engine. PSUseCompatibleSyntax checks against the |
| 16 | + # target language versions regardless of the engine the analyzer runs under, so a |
| 17 | + # PowerShell 7+-only construct (for example the ternary operator) is caught even |
| 18 | + # when the analyzer runs from pwsh. |
| 19 | + # |
| 20 | + # The profile-based PSUseCompatibleCommands / PSUseCompatibleTypes rules are |
| 21 | + # intentionally NOT enabled here: they produced false positives on this codebase |
| 22 | + # (provider dynamic parameters and required-module commands) and intermittently |
| 23 | + # threw a NullReferenceException inside Invoke-ScriptAnalyzer on some platforms, |
| 24 | + # which aborts the whole analysis. Core-only cmdlet/type usage is instead covered |
| 25 | + # by the Windows PowerShell 5.1 import-smoke CI job. |
19 | 26 | PSUseCompatibleSyntax = @{ |
20 | 27 | Enable = $true |
21 | 28 | TargetVersions = @('5.1', '7.0') |
22 | 29 | } |
23 | | - PSUseCompatibleCommands = @{ |
24 | | - Enable = $true |
25 | | - TargetProfiles = @( |
26 | | - 'win-8_x64_10.0.17763.0_5.1.17763.316_x64_4.0.30319.42000_framework' |
27 | | - 'win-8_x64_10.0.17763.0_7.0.0_x64_3.1.2_core' |
28 | | - ) |
29 | | - } |
30 | | - PSUseCompatibleTypes = @{ |
31 | | - Enable = $true |
32 | | - TargetProfiles = @( |
33 | | - 'win-8_x64_10.0.17763.0_5.1.17763.316_x64_4.0.30319.42000_framework' |
34 | | - 'win-8_x64_10.0.17763.0_7.0.0_x64_3.1.2_core' |
35 | | - ) |
36 | | - } |
37 | 30 | } |
38 | 31 | } |
0 commit comments