#Requires -RunAsAdministrator # Services that consume resources without adding value in a minimal VM $disable = @{ "DiagTrack" = "Connected User Experiences and Telemetry" "dmwappushservice" = "WAP Push Message Routing" "SysMain" = "Superfetch — causes high I/O in VMs" "WSearch" = "Windows Search indexer — CPU/disk heavy" "MapsBroker" = "Downloaded Maps Manager" "lfsvc" = "Geolocation Service" "XblAuthManager" = "Xbox Live Auth Manager" "XblGameSave" = "Xbox Live Game Save" "XboxGipSvc" = "Xbox Accessory Management" "XboxNetApiSvc" = "Xbox Live Networking" "RetailDemo" = "Retail Demo" "Fax" = "Fax" "WbioSrvc" = "Windows Biometric (no fingerprint reader in VM)" "WMPNetworkSvc" = "Windows Media Player Network Sharing" "icssvc" = "Mobile Hotspot" "SharedAccess" = "Internet Connection Sharing" "wisvc" = "Windows Insider Service" "PcaSvc" = "Program Compatibility Assistant" "wercplsupport" = "Problem Reports control panel support" } foreach ($name in $disable.Keys) { $svc = Get-Service -Name $name -ErrorAction SilentlyContinue if ($svc) { Stop-Service -Name $name -Force -ErrorAction SilentlyContinue Set-Service -Name $name -StartupType Disabled -ErrorAction SilentlyContinue } }