[release/v7.6.2] Fix checks for local user config file paths by daxian-dbw · Pull Request #27432 · PowerShell/PowerShell
Backport of #26269 to release/v7.6.2
Triggered by @daxian-dbw on behalf of @SeeminglyScience
Original CL Label: CL-Engine
/cc @PowerShell/powershell-maintainers
Impact
REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.
Tooling Impact
- Required tooling change
- Optional tooling change (include reasoning)
Customer Impact
- Customer reported
- Found internally
Fixes incorrect config file path resolution for the SYSTEM account and handles empty/null paths from GetFolderPath, preventing potential issues loading PowerShell user config files.
Regression
REQUIRED: Check exactly one box.
- Yes
- No
This is not a regression.
Testing
Verified via the original PR. The change uses DoNotVerify option with Environment.GetFolderPath and skips loading when an empty/null/whitespace path is returned. No new tests were added as the scenario can only be tested interactively.
Risk
REQUIRED: Check exactly one box.
- High
- Medium
- Low
Targeted fix to config path resolution logic. Only affects edge cases (SYSTEM account path and empty GetFolderPath results). No behavioral change for standard users.