- Organized 252 files across project - Root directory: 187 → 2 files (98.9% reduction) - Moved configuration guides to docs/04-configuration/ - Moved troubleshooting guides to docs/09-troubleshooting/ - Moved quick start guides to docs/01-getting-started/ - Moved reports to reports/ directory - Archived temporary files - Generated comprehensive reports and documentation - Created maintenance scripts and guides All files organized according to established standards.
53 lines
1.9 KiB
PowerShell
53 lines
1.9 KiB
PowerShell
# PowerShell script to restart WSL
|
|
# Run from Windows PowerShell: .\scripts\restart-wsl.ps1
|
|
|
|
Write-Host "==========================================" -ForegroundColor Cyan
|
|
Write-Host "WSL Restart Script" -ForegroundColor Cyan
|
|
Write-Host "==========================================" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
|
|
# Check if running as administrator
|
|
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
|
|
|
|
if (-not $isAdmin) {
|
|
Write-Host "Note: Not running as administrator. Some operations may require elevation." -ForegroundColor Yellow
|
|
Write-Host ""
|
|
}
|
|
|
|
# List current WSL distributions
|
|
Write-Host "Current WSL distributions:" -ForegroundColor Green
|
|
wsl --list --verbose
|
|
Write-Host ""
|
|
|
|
# Ask for confirmation
|
|
$response = Read-Host "Do you want to restart WSL? (y/N)"
|
|
if ($response -ne 'y' -and $response -ne 'Y') {
|
|
Write-Host "Cancelled." -ForegroundColor Yellow
|
|
exit
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "Restarting WSL (Ubuntu)..." -ForegroundColor Green
|
|
wsl --terminate Ubuntu
|
|
|
|
if ($LASTEXITCODE -eq 0) {
|
|
Write-Host "✅ WSL (Ubuntu) terminated successfully." -ForegroundColor Green
|
|
Write-Host ""
|
|
Write-Host "WSL will restart automatically when you connect to it again." -ForegroundColor Cyan
|
|
Write-Host "Reconnect to WSL in Cursor to verify the fix." -ForegroundColor Cyan
|
|
} else {
|
|
Write-Host "⚠️ Could not terminate WSL. Trying full shutdown..." -ForegroundColor Yellow
|
|
wsl --shutdown
|
|
if ($LASTEXITCODE -eq 0) {
|
|
Write-Host "✅ All WSL distributions shut down." -ForegroundColor Green
|
|
} else {
|
|
Write-Host "❌ Failed to restart WSL. You may need to run this as Administrator." -ForegroundColor Red
|
|
}
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "After reconnecting, verify the fix:" -ForegroundColor Cyan
|
|
Write-Host " which code" -ForegroundColor White
|
|
Write-Host " code --version" -ForegroundColor White
|
|
|