Last active
August 17, 2020 21:21
-
-
Save lalibi/5ef3a5547b24cb8d18cebb3f752ac631 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Working around the dreaded Dell XPS “Power Limit Throttling” problem | by Matthew Casperson | Medium - https://bit.ly/31Coh5d | |
# Problem with ending a loop on keypress - PowerShell General - Ask the Experts - IDERA Community - https://bit.ly/31DemvZ | |
# Automated Power Limit Script - Feedback : gpdwin - https://bit.ly/33RxeKJ | |
# windows 10 - Intel XTU Undervolt settings not working between reboots - Super User - https://bit.ly/2FbgUKp | |
# Apply an Intel XTU profile from PowerShell - https://bit.ly/2Fbw3eI | |
# **DISCLAIMER**: Use the script at your own risk. I've been running it successfully for several days now | |
# but I can't say that this is a safe practise and **I cannot guarantee that it won't damage your laptop**. | |
# Use it only if you understand what the script does, if you understand the risks involved, | |
# if you understand what those settings are and, finally, if you feel comfortable with tinkering those values. | |
# In any case, I won't be held responsible if any damage happens to your laptop. | |
$power_limit_throttling_id = 22 | |
$turbo_boost_power_max_id = 48 | |
$turbo_boost_power_max_value = 45 # W | |
$turbo_boost_power_max_value_alt = 46 # W | |
Push-Location ~\Desktop\Client | |
$timestamp = Get-Date -Format "HH:mm:ss" # Get-Date -DisplayHint Time | |
Write-Host "`nMonitoring for 'Power Limit Throttling'" -ForegroundColor Cyan -NoNewline | |
Write-Host " (Press Q to exit)" -ForegroundColor Green | |
Write-Host "`nStart`t`t`t$timestamp" | |
$sleep = 2 # seconds | |
while ($true) | |
{ | |
$timestamp = Get-Date -Format "HH:mm:ss" # Get-Date -DisplayHint Time | |
$output = & .\XtuCLI.exe -m -id $power_limit_throttling_id | Out-String | |
$output -match "Power Limit Throttling\s+([01])" | Out-Null | |
if ($Matches[1] -eq 1) | |
{ | |
Write-Host "`nPower limit throttling`t" -ForegroundColor Red -NoNewline | |
Write-Host $timestamp | |
& .\XtuCLI.exe -t -id $turbo_boost_power_max_id -v $turbo_boost_power_max_value_alt | Out-Null | |
Start-Sleep $sleep | |
& .\XtuCLI.exe -t -id $turbo_boost_power_max_id -v $turbo_boost_power_max_value | Out-Null | |
} | |
else | |
{ | |
Write-Host "`rLast check`t`t$timestamp" -NoNewline | |
} | |
if ($Host.UI.RawUI.KeyAvailable -and ("q" -eq $Host.UI.RawUI.ReadKey("IncludeKeyUp,NoEcho").Character)) | |
{ | |
break | |
} | |
else | |
{ | |
Start-Sleep $sleep | |
} | |
} | |
Write-Host `n | |
Pop-Location |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment