PowerShell Shell Detection & Cross-Shell Compatibility Critical guidance for distinguishing between PowerShell and Git Bash/MSYS2 shells on Windows, with shell-specific path handling and compatibility notes. Shell Detection Priority (Windows) When working on Windows, correctly identifying the shell environment is crucial for proper path handling and command execution. Detection Order (Most Reliable First) 1. process.env.PSModulePath (PowerShell specific) 2. process.env.MSYSTEM (Git Bash/MinGW specific) 3. process.env.WSL DISTRO NAME (WSL specific) 4. uname -s output (Cross-shell, requires exe…