Skip to content

Guard against quoted PATH entries containing semicolons #2

Description

@ekalb81

Problem

Split-PathEntries (Windows-Path-Repair-Full.ps1, ~line 44) splits the raw PATH value on every ;. Windows PATH permits quoted entries such as "C:\Program Files;odd". If such an entry exists, the script splits it into two invalid fragments and would persist that corruption on -Apply.

Proposed fix

Rare edge case, so a conservative guard is enough: if the raw Machine or User PATH value contains a double-quote character, refuse to proceed (or at minimum warn loudly and require an explicit override switch), consistent with the tool's preview-and-approve philosophy. A full quoted-segment parser is optional follow-up.

Acceptance criteria

  • A PATH value containing " triggers the guard before any plan is computed for that scope.
  • Test covering the guard (both rejection and, if an override is added, the override path).
  • README note in the safety section.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions