#Requires -RunAsAdministrator # ── Power plan: High Performance ──────────────────────────────────────────── powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c # ── Hibernate: off (saves ~RAM-size on disk) ───────────────────────────────── powercfg /hibernate off # ── System Restore: off (saves disk and shadow-copy overhead) ──────────────── Disable-ComputerRestore -Drive "C:\" -ErrorAction SilentlyContinue vssadmin delete shadows /for=C: /all /quiet 2>$null # ── Visual effects: best performance ───────────────────────────────────────── $ve = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" New-Item -Path $ve -Force -ErrorAction SilentlyContinue | Out-Null Set-ItemProperty -Path $ve -Name VisualFXSetting -Value 2 -Type DWord $desktop = "HKCU:\Control Panel\Desktop" Set-ItemProperty -Path $desktop -Name DragFullWindows -Value "0" Set-ItemProperty -Path $desktop -Name MenuShowDelay -Value "0" $adv = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" Set-ItemProperty -Path $adv -Name TaskbarAnimations -Value 0 -Type DWord Set-ItemProperty -Path $adv -Name DisallowShaking -Value 1 -Type DWord # ── Page file: fixed size to avoid resize churn ────────────────────────────── $cs = Get-WmiObject Win32_ComputerSystem -EnableAllPrivileges $cs.AutomaticManagedPagefile = $false $cs.Put() | Out-Null $pf = Get-WmiObject -Query "Select * From Win32_PageFileSetting Where Name='C:\\pagefile.sys'" if ($pf) { $pf.InitialSize = 2048 $pf.MaximumSize = 4096 $pf.Put() | Out-Null } # ── NTFS: skip Last Access Time updates ────────────────────────────────────── fsutil behavior set disablelastaccess 1 | Out-Null # ── Processor scheduling: favor background services (better for VM workloads) ─ Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\PriorityControl" ` -Name Win32PrioritySeparation -Value 24 -Type DWord