Summary
Two variables are assigned but never used. PSScriptAnalyzer flags both with PSUseDeclaredVarsMoreThanAssignments.
Files
| File |
Line |
Variable |
Source |
Issue |
Public/Test-FeatureFlag.ps1 |
41 |
$config |
Import-GatekeeperConfig |
Config reloaded by Invoke-Logging internally; this call is dead |
Public/Test-Condition.ps1 |
86 |
$validation |
$meta.Validation |
Validation is passed via $meta to Test-TypedValue; $validation is never referenced |
Fix
Remove both assignments:
# Test-FeatureFlag.ps1 begin{} — remove this line:
$config = Import-GatekeeperConfig
# Test-Condition.ps1 — remove this line:
$validation = $meta.Validation
Notes
- Good first issue
- Found by Brent Tlackburn and Chip Torres
Summary
Two variables are assigned but never used. PSScriptAnalyzer flags both with
PSUseDeclaredVarsMoreThanAssignments.Files
Public/Test-FeatureFlag.ps1$configImport-GatekeeperConfigInvoke-Logginginternally; this call is deadPublic/Test-Condition.ps1$validation$meta.Validation$metatoTest-TypedValue;$validationis never referencedFix
Remove both assignments:
Notes