Local Reinstall Windows May 2026

private async Task UseSystemResetAPI(ResetOptions options)

# Backup if needed if ($KeepFiles) Out-Null # Backup user folders $userFolders = @("Documents", "Pictures", "Music", "Videos", "Desktop", "Downloads") foreach ($folder in $userFolders) $sourcePath = Join-Path $env:USERPROFILE $folder if (Test-Path $sourcePath) Copy-Item -Path $sourcePath -Destination $backupPath -Recurse -Force Write-Host "Backup completed to: $backupPath" -ForegroundColor Green

private async Task CopyDirectoryAsync(string source, string destination)

private async Task UseSystemResetAPI(ResetOptions options)

# Backup if needed if ($KeepFiles) Out-Null # Backup user folders $userFolders = @("Documents", "Pictures", "Music", "Videos", "Desktop", "Downloads") foreach ($folder in $userFolders) $sourcePath = Join-Path $env:USERPROFILE $folder if (Test-Path $sourcePath) Copy-Item -Path $sourcePath -Destination $backupPath -Recurse -Force Write-Host "Backup completed to: $backupPath" -ForegroundColor Green

private async Task CopyDirectoryAsync(string source, string destination)

Go to site