mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2026-04-11 17:37:18 +10:00
* Simplfy Invoke-WPFUltimatePerformance.ps1 * Update Invoke-WPFButton.ps1 * Update Invoke-WPFUltimatePerformance.ps1 * Update Invoke-WPFUltimatePerformance.ps1 * Update Invoke-WPFButton.ps1 * Update Invoke-WPFUltimatePerformance.ps1 * Update Invoke-WPFUltimatePerformance.ps1 * Update Invoke-WPFUltimatePerformance.ps1 * Update Invoke-WPFUltimatePerformance.ps1
24 lines
971 B
PowerShell
24 lines
971 B
PowerShell
function Invoke-WPFUltimatePerformance {
|
|
param(
|
|
[switch]$Do
|
|
)
|
|
|
|
if ($Do) {
|
|
if (-not (powercfg /list | Select-String "Ultimate Performance")) {
|
|
powercfg /setactive ((powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61).Split()[3])
|
|
Write-Host "Ultimate Performance plan installed and activated." -ForegroundColor Green
|
|
} else {
|
|
Write-Host "Ultimate Performance plan is already installed." -ForegroundColor Red
|
|
return
|
|
}
|
|
} else {
|
|
if (powercfg /list | Select-String "Ultimate Performance") {
|
|
powercfg /setactive SCHEME_BALANCED
|
|
powercfg /delete ((powercfg /list | Select-String "Ultimate Performance").ToString().Split()[3])
|
|
Write-Host "Ultimate Performance plan was removed." -ForegroundColor Red
|
|
} else {
|
|
Write-Host "Ultimate Performance plan is not installed." -ForegroundColor Yellow
|
|
}
|
|
}
|
|
}
|