Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Windows Junction Manager

A portable PowerShell 7 tool and interactive terminal UI for managing Windows directory junctions (reparse points).

5 modules and 24 actions, driven by one shared catalog.

Windows Junction Manager creates, inspects, repairs, cleans, exports and restores junctions while keeping protected system and user-profile compatibility paths untouched. Every mutating action supports a dry-run preview.

What it does

AreaCapability
DiscoveryScan standard locations or any custom directory, inspect one junction, summarize health
LifecycleCreate, retarget with rollback, repair and remove junctions
CleanupRemove orphaned links, empty-target links, or both, with optional empty-target reclamation
InventoryJSON/CSV export, timestamped backup snapshots, import preview and guarded restore
SafetyProtected-path policy, dry-run everywhere, confirmation for destructive headless actions

How the pieces fit

flowchart TD
    A["JunctionManager.bat<br/>PATH pwsh launcher"] --> B["JunctionManager.ps1<br/>root entry point"]
    B --> C["src/menu.ps1<br/>CLI dispatcher + TUI"]
    C --> D["src/core/manifest.ps1<br/>load-order manifest"]
    D --> E["version.ps1"]
    D --> F["paths.ps1"]
    D --> G["junctions.ps1"]
    D --> H["operations.ps1"]
    D --> I["inventory.ps1"]
    D --> J["catalog.ps1"]
    D --> K["logger.ps1"]
    D --> L["ui-helpers.ps1"]
    C --> M["TUI surfaces"]
    C --> N["Headless CLI"]
    M --> O["5 modules / 24 actions"]
    N --> O

Junction status model

stateDiagram-v2
    [*] --> Active: target exists and contains files
    [*] --> StaleOrphaned: target directory missing
    [*] --> StaleEmpty: target exists but contains no files
    [*] --> Missing: inspected path does not exist
    [*] --> NotAJunction: path exists but is not a junction
    StaleOrphaned --> [*]: cleanup detaches the link
    StaleEmpty --> [*]: cleanup detaches the link, optional target reclaim
    Active --> [*]: remove detaches the link, target kept

Quick start

JunctionManager.bat
JunctionManager.bat --list
JunctionManager.bat --scan
JunctionManager.bat --clean-stale --dry-run

Where to go next

Requirements

  • Windows 11
  • PowerShell 7.x (pwsh)

No installation is required. The batch launchers use pwsh from PATH.