# PCS Toolkit - Driver Backup $timestamp = Get-Date -Format "yyyy-MM-dd_HH-mm-ss" $backupPath = "$env:USERPROFILE\Desktop\DriverBackup_$timestamp" $logFile = "$backupPath\backup.log" New-Item -ItemType Directory -Path $backupPath -Force | Out-Null function Log($msg) { $line = "$(Get-Date -Format 'HH:mm:ss') - $msg" Write-Host $line Add-Content $logFile $line } Log "========================================" Log " PCS Toolkit - Driver Backup" Log "========================================" Log "Backup location: $backupPath" Log "" Log "Exporting drivers (this may take a few minutes)..." $result = dism /online /export-driver /destination:"$backupPath" Log $result Log "" Log "========================================" Log "BACKUP COMPLETE" Log "========================================" $driverCount = (Get-ChildItem $backupPath -Directory).Count Log "Backed up $driverCount driver packages" Log "Location: $backupPath" explorer.exe $backupPath Read-Host "Press Enter to exit"