# Ensure the script is running with Admin privileges if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { Write-Warning "This script must be run as an Administrator!" Exit } Write-Host "Applying power settings..." -ForegroundColor Cyan # 1. Set Power Scheme to High Performance powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c # 2. Set Power and Sleep buttons to Shutdown (AC = Plugged In, DC = Battery) powercfg /setacvalueindex SCHEME_CURRENT SUB_BUTTONS PBUTTON 3 powercfg /setdcvalueindex SCHEME_CURRENT SUB_BUTTONS PBUTTON 3 powercfg /setacvalueindex SCHEME_CURRENT SUB_BUTTONS SBUTTON 3 powercfg /setdcvalueindex SCHEME_CURRENT SUB_BUTTONS SBUTTON 3 # 3 & 4. Screen off after 10 minutes (600 seconds) powercfg /setacvalueindex SCHEME_CURRENT SUB_VIDEO VIDEOIDLE 600 powercfg /setdcvalueindex SCHEME_CURRENT SUB_VIDEO VIDEOIDLE 600 # 5. Sleep timeout to Never (0 seconds) powercfg /setacvalueindex SCHEME_CURRENT SUB_SLEEP STANDBYIDLE 0 powercfg /setdcvalueindex SCHEME_CURRENT SUB_SLEEP STANDBYIDLE 0 # Apply changes actively powercfg /setactive SCHEME_CURRENT Write-Host "Power settings successfully applied!" -ForegroundColor Green