Last active
September 2, 2025 01:21
-
-
Save loorlab/a48ff76aae79c0a97d829ac03a6ac734 to your computer and use it in GitHub Desktop.
Restore Backup VS Code - Extensions + Settings - WIN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# === RESTAURAR VS CODE === | |
$ErrorActionPreference = 'Stop' | |
# Ruta de backup | |
$backupPath = Join-Path $env:USERPROFILE 'Documents\VSCode_Backup' | |
$extPath = Join-Path $env:USERPROFILE '.vscode\extensions' | |
$settingsPath = Join-Path $env:APPDATA 'Code\User' | |
Write-Host ('Restaurando desde: ' + $backupPath) | |
# Restaurar extensiones | |
if (Test-Path (Join-Path $backupPath 'extensions')) { | |
Write-Host 'Restaurando extensiones...' | |
Copy-Item -Path (Join-Path $backupPath 'extensions') -Destination $extPath -Recurse -Force | |
Write-Host '✔ Extensiones restauradas.' | |
} else { | |
Write-Host '❌ No se encontro backup de extensiones.' | |
} | |
# Restaurar configuraciones | |
if (Test-Path (Join-Path $backupPath 'User')) { | |
Write-Host 'Restaurando configuraciones...' | |
Copy-Item -Path (Join-Path $backupPath 'User') -Destination $settingsPath -Recurse -Force | |
Write-Host '✔ Configuraciones restauradas.' | |
} else { | |
Write-Host '❌ No se encontró backup de configuraciones.' | |
} | |
# Reinstalar extensiones desde lista | |
$extList = Join-Path $backupPath 'extensions-list.txt' | |
if (Test-Path $extList) { | |
Write-Host 'Reinstalando extensiones desde la lista...' | |
Get-Content $extList | ForEach-Object { code --install-extension $_ } | |
Write-Host '✔ Extensiones reinstaladas.' | |
} else { | |
Write-Host '❌ No se encontró extensions-list.txt' | |
} | |
Write-Host '=== Restauración completada ===' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Step 1:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Step 2:
.\restore-vscode.ps1