$isAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) if (-not $isAdmin) { Clear-Host Write-Host "================================================================" -ForegroundColor Red Write-Host " PERINGATAN AKSES " -ForegroundColor Yellow Write-Host "================================================================" -ForegroundColor Red Write-Host "Script ini membutuhkan hak akses Administrator, bro." Write-Host "Silakan tutup jendela ini, lalu buka PowerShell dengan cara:" Write-Host "Klik Kanan -> 'Run as Administrator'" -ForegroundColor Cyan Write-Host "" Read-Host "Tekan Enter untuk keluar..." Exit } Clear-Host Write-Host "[+] Script berhasil dimuat dari server." -ForegroundColor Green Write-Host "" Read-Host "Tekan [Enter] untuk masuk ke menu utama, santai dulu bro..." do { Clear-Host Write-Host " ____ _ _ ____ ____ _ _____ ___ _ _ " -ForegroundColor Cyan Write-Host " | _ \`| | | / ___|| _ \ / \`|_ _|_ _| \ | |" -ForegroundColor Cyan Write-Host " | |_) | | | \___ \| | | |/ _ \ | | | || \| |" -ForegroundColor Cyan Write-Host " | __/| |_| |___) | |_| / ___ \| | | || |\ |" -ForegroundColor Cyan Write-Host " |_| \___/|____/|____/_/ \_\_| |___|_| \_|" -ForegroundColor Cyan Write-Host "" Write-Host " __ __ " -ForegroundColor Magenta Write-Host " \ \/ / " -ForegroundColor Magenta Write-Host " > < " -ForegroundColor Magenta Write-Host " /_/\_\ " -ForegroundColor Magenta Write-Host "" Write-Host " _____ _ __ _ _ _ ____ _ _ " -ForegroundColor Yellow Write-Host " |_ _| \ \/ / | | | | / \ / ___|| | | | " -ForegroundColor Yellow Write-Host " | | \ / | |_| | / _ \ \___ \| |_| | " -ForegroundColor Yellow Write-Host " | | / \ | _ |/ ___ \ ___) | _ | " -ForegroundColor Yellow Write-Host " |_| /_/\_\ |_| |_/_/ \_\____/|_| |_| " -ForegroundColor Yellow Write-Host "" Write-Host " --- AUTOMATION TOOLKIT SYSTEM --- " -ForegroundColor White Write-Host "" Write-Host "================================================================" -ForegroundColor DarkGray Write-Host " [1] Eksekusi Backup Driver ke Desktop" Write-Host " [2] Aktivasi Windows / Microsoft Office" Write-Host " [3] Bersihkan Sampah (Disk Cleanup & Temp Files)" Write-Host " [4] Perbaiki File Sistem (SFC Scan)" Write-Host " [5] Reset Network & Flush DNS" Write-Host " [0] Keluar" Write-Host "================================================================" -ForegroundColor DarkGray Write-Host "" $pilihan = Read-Host "Pilih menu (1/2/3/4/5/0)" switch ($pilihan) { '1' { $desktopPath = [Environment]::GetFolderPath("Desktop") $backupDir = Join-Path -Path $desktopPath -ChildPath "backup drivers" if (-not (Test-Path -Path $backupDir)) { New-Item -ItemType Directory -Path $backupDir | Out-Null } Write-Host "`n[+] Memulai proses backup ke: $backupDir" -ForegroundColor Cyan Write-Host "[+] Mengekstrak driver (Log ditampilkan di bawah)...`n" -ForegroundColor Yellow try { Export-WindowsDriver -Online -Destination $backupDir | Select-Object ClassName, ProviderName, Date, Version | Format-Table -AutoSize Write-Host "`n[+] Backup Selesai! Semua driver berhasil disalin ke folder $backupDir." -ForegroundColor Green } catch { Write-Host "`n[-] Terjadi kesalahan saat melakukan backup." -ForegroundColor Red Write-Host $_.Exception.Message -ForegroundColor Red } Write-Host "" Read-Host "Tekan Enter untuk kembali ke menu..." } '2' { Write-Host "`n[+] Menghubungkan ke server aktivasi Microsoft..." -ForegroundColor Cyan Write-Host "[+] Mohon tunggu, memuat antarmuka aktivasi...`n" -ForegroundColor Yellow try { irm https://get.activated.win/ | iex } catch { Write-Host "`n[-] Gagal terhubung ke server aktivasi. Pastikan koneksi internet stabil." -ForegroundColor Red } Write-Host "" Read-Host "Tekan Enter untuk kembali ke menu..." } '3' { Write-Host "`n[+] Memulai pembersihan file sampah (Temp, Prefetch, Recycle Bin)..." -ForegroundColor Cyan try { Remove-Item -Path "$env:TEMP\*" -Recurse -Force -ErrorAction SilentlyContinue Remove-Item -Path "$env:windir\Temp\*" -Recurse -Force -ErrorAction SilentlyContinue Remove-Item -Path "$env:windir\Prefetch\*" -Recurse -Force -ErrorAction SilentlyContinue Clear-RecycleBin -Force -ErrorAction SilentlyContinue Write-Host "[+] Berhasil! Ruang penyimpanan sudah lebih lega." -ForegroundColor Green } catch { Write-Host "[-] Ada beberapa file yang sedang digunakan oleh Windows dan dilompati (wajar bro)." -ForegroundColor Yellow } Write-Host "" Read-Host "Tekan Enter untuk kembali ke menu..." } '4' { Write-Host "`n[+] Memulai System File Checker (SFC Scan)..." -ForegroundColor Cyan Write-Host "[+] Proses ini butuh waktu beberapa menit, ngopi dulu aja bro..." -ForegroundColor Yellow sfc /scannow Write-Host "" Read-Host "Tekan Enter untuk kembali ke menu..." } '5' { Write-Host "`n[+] Mereset Network dan Flush DNS..." -ForegroundColor Cyan ipconfig /flushdns | Out-Null netsh winsock reset | Out-Null Write-Host "[+] Jaringan dan DNS berhasil di-reset. (PC perlu di-restart untuk efek maksimal)" -ForegroundColor Green Write-Host "" Read-Host "Tekan Enter untuk kembali ke menu..." } '0' { Write-Host "`nKeluar dari program. Stay chill, bro!" -ForegroundColor DarkGray Start-Sleep -Seconds 1 } default { Write-Host "`nPilihan tidak valid, coba lagi bro!" -ForegroundColor Red Start-Sleep -Seconds 1 } } } while ($pilihan -ne '0')