Write-Host "Fixing Scoop shims for git..." $scoopDir = "E:\Scoop" $gitDir = "E:\Scoop\apps\git\2.53.0" $shimsDir = "E:\Scoop\shims" Write-Host "1. Checking git installation..." if (-not (Test-Path "$gitDir\bin\git.exe")) { Write-Host "ERROR: git.exe not found at $gitDir\bin\git.exe" exit 1 } Write-Host " git.exe found" Write-Host "2. Fixing sh.shim..." $shShim = "$shimsDir\sh.shim" if (Test-Path $shShim) { $content = Get-Content $shShim if ($content -match "current") { Set-Content $shShim 'path = "E:\Scoop\apps\git\2.53.0\bin\sh.exe"' Write-Host " Updated sh.shim to use absolute path" } else { Write-Host " sh.shim already uses absolute path" } } else { Write-Host " ERROR: sh.shim not found" } Write-Host "3. Creating git shim..." $gitShim = "$shimsDir\git.shim" if (-not (Test-Path $gitShim)) { Set-Content $gitShim 'path = "E:\Scoop\apps\git\2.53.0\bin\git.exe"' Write-Host " Created git.shim" } else { Write-Host " git.shim already exists" } Write-Host "4. Creating git.exe shim executable..." $gitExe = "$shimsDir\git.exe" if (-not (Test-Path $gitExe)) { $sourceShim = "$shimsDir\7z.exe" if (Test-Path $sourceShim) { Copy-Item $sourceShim $gitExe Write-Host " Copied 7z.exe to git.exe" } else { Write-Host " ERROR: No source shim executable found" } } else { Write-Host " git.exe already exists" } Write-Host "5. Testing git command..." $env:Path = "$shimsDir;$env:Path" try { git --version Write-Host " SUCCESS: git command works!" } catch { Write-Host " WARNING: git command may not work directly, but you can use full path: $gitDir\bin\git.exe" } Write-Host "6. Testing sh command..." try { sh --version Write-Host " SUCCESS: sh command works!" } catch { Write-Host " WARNING: sh command may not work" } Write-Host "`nFix complete. If commands still don't work, try restarting your terminal or running:" Write-Host " . `$env:Path = `"E:\Scoop\shims;`$env:Path`""