File size: 485 Bytes
7fd1a0e
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
# Backup-Path.ps1
# Guarda o PATH atual do utilizador num ficheiro para restauro posterior.

$backupFile = "$PSScriptRoot\path_backup.txt"
$currentPath = [Environment]::GetEnvironmentVariable("PATH", "User")

if ($currentPath) {
    $currentPath | Out-File -FilePath $backupFile -Encoding utf8
    Write-Host "✅ Backup do PATH (User) guardado em: $backupFile" -ForegroundColor Green
} else {
    Write-Warning "O PATH do utilizador está vazio ou não pôde ser lido."
}