-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpurge-and-fix.ps1
More file actions
19 lines (14 loc) · 943 Bytes
/
purge-and-fix.ps1
File metadata and controls
19 lines (14 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# BVM Environment Purger (Clean Slate Only)
# Use this to remove all BVM-related paths from Registry and Session.
Write-Host "🧹 Purging BVM Environment Variables..." -ForegroundColor Yellow
# 1. Clean User Registry
$oldPath = [Environment]::GetEnvironmentVariable("Path", "User")
$cleanPath = ($oldPath -split ";" | Where-Object { $_ -notlike "*\.bvm*" -and $_ -ne "" }) -join ";"
[Environment]::SetEnvironmentVariable("Path", $cleanPath, "User")
[Environment]::SetEnvironmentVariable("BVM_DIR", $null, "User")
Write-Host "✅ User Registry Cleaned (All .bvm entries removed)." -ForegroundColor Green
# 2. Clean Current Session
$env:PATH = ($env:PATH -split ";" | Where-Object { $_ -notlike "*\.bvm*" }) -join ";"
Remove-Item env:BVM_DIR -ErrorAction SilentlyContinue
Write-Host "✅ Current Session Cleaned." -ForegroundColor Green
Write-Host "Now you can run a fresh 'npm install -g bvm-core' to re-initialize." -ForegroundColor Cyan