32 lines
1.4 KiB
PowerShell
32 lines
1.4 KiB
PowerShell
# restore-cowork-memory.ps1
|
|
# Restaure les fichiers mémoire Cowork depuis le repo Git vers l'installation Claude Desktop
|
|
|
|
$repoMemory = "$PSScriptRoot\memory\ef8f4a3f-abbf-422c-8382-f0bf9d3a9cdf\memory"
|
|
$coworkSpace = "C:\Users\olivi\AppData\Roaming\Claude\local-agent-mode-sessions\cad3a9c0-cf8e-4204-ac6e-e22c03811abe\7707aa40-4613-41ca-918f-a32d6df19bce\spaces\ef8f4a3f-abbf-422c-8382-f0bf9d3a9cdf\memory"
|
|
|
|
# Vérifier que le repo source existe
|
|
if (-not (Test-Path $repoMemory)) {
|
|
Write-Host "Erreur : dossier source introuvable : $repoMemory" -ForegroundColor Red
|
|
exit 1
|
|
}
|
|
|
|
# Créer la destination si elle n'existe pas
|
|
if (-not (Test-Path $coworkSpace)) {
|
|
New-Item -ItemType Directory -Path $coworkSpace -Force | Out-Null
|
|
Write-Host "Dossier Cowork créé." -ForegroundColor Yellow
|
|
}
|
|
|
|
# Backup de l'existant si non vide
|
|
$existing = Get-ChildItem $coworkSpace -ErrorAction SilentlyContinue
|
|
if ($existing) {
|
|
$backupPath = "$coworkSpace`_backup_$(Get-Date -Format 'yyyyMMdd_HHmm')"
|
|
robocopy $coworkSpace $backupPath /E /NFL /NDL | Out-Null
|
|
Write-Host "Backup de l'existant créé : $backupPath" -ForegroundColor Yellow
|
|
}
|
|
|
|
# Restauration
|
|
Write-Host "Restauration des fichiers mémoire Cowork..." -ForegroundColor Cyan
|
|
robocopy $repoMemory $coworkSpace /E /NFL /NDL
|
|
|
|
Write-Host ""
|
|
Write-Host "Restauration terminée. Relance Claude Desktop pour que Cowork prenne en compte les fichiers." -ForegroundColor Green |