chore: Update generated dev docs (#4332)

This commit is contained in:
Chris Titus
2026-04-07 13:00:56 -05:00
committed by GitHub
parent 406d6fdfc4
commit 372fa0159a
3 changed files with 35 additions and 157 deletions

View File

@@ -11,7 +11,7 @@ description: ""
"panel": "1", "panel": "1",
"service": [ "service": [
{ {
"Name": "lfsvc ", "Name": "lfsvc",
"StartupType": "Disable", "StartupType": "Disable",
"OriginalType": "Manual" "OriginalType": "Manual"
} }

View File

@@ -4,88 +4,27 @@ description: ""
--- ---
```powershell {filename="functions/public/Invoke-WPFUltimatePerformance.ps1",linenos=inline,linenostart=1} ```powershell {filename="functions/public/Invoke-WPFUltimatePerformance.ps1",linenos=inline,linenostart=1}
Function Invoke-WPFUltimatePerformance { function Invoke-WPFUltimatePerformance {
<#
.SYNOPSIS
Enables or disables the Ultimate Performance power scheme based on its GUID.
.PARAMETER State
Specifies whether to "Enable" or "Disable" the Ultimate Performance power scheme.
#>
param( param(
[Parameter(Mandatory = $true)] [switch]$Do
[ValidateSet("Enable", "Disable")]
[string]$State
) )
try { if ($Do) {
# GUID of the Ultimate Performance power plan if (-not (powercfg /list | Select-String "Ultimate Performance")) {
$ultimateGUID = "e9a42b02-d5df-448d-aa00-03f14749eb61" powercfg /setactive ((powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61).Split()[3])
Write-Host "Ultimate Performance plan installed and activated." -ForegroundColor Green
switch ($State) { } else {
"Enable" { Write-Host "Ultimate Performance plan is already installed." -ForegroundColor Red
# Duplicate the Ultimate Performance power plan using its GUID return
$duplicateOutput = powercfg /duplicatescheme $ultimateGUID }
} else {
$guid = $null if (powercfg /list | Select-String "Ultimate Performance") {
$nameFromFile = "ChrisTitus - Ultimate Power Plan" powercfg /setactive SCHEME_BALANCED
$description = "Ultimate Power Plan, added via WinUtils" powercfg /delete ((powercfg /list | Select-String "Ultimate Performance").ToString().Split()[3])
Write-Host "Ultimate Performance plan was removed." -ForegroundColor Red
# Extract the new GUID from the duplicateOutput } else {
foreach ($line in $duplicateOutput) { Write-Host "Ultimate Performance plan is not installed." -ForegroundColor Yellow
if ($line -match "\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b") {
$guid = $matches[0] # $matches[0] will contain the first match, which is the GUID
Write-Output "GUID: $guid has been extracted and stored in the variable."
break
}
}
if (-not $guid) {
Write-Output "No GUID found in the duplicateOutput. Check the output format."
exit 1
}
# Change the name of the power plan and set its description
$changeNameOutput = powercfg /changename $guid "$nameFromFile" "$description"
Write-Output "The power plan name and description have been changed. Output:"
Write-Output $changeNameOutput
# Set the duplicated Ultimate Performance plan as active
$setActiveOutput = powercfg /setactive $guid
Write-Output "The power plan has been set as active. Output:"
Write-Output $setActiveOutput
Write-Host "> Ultimate Performance plan installed and set as active."
}
"Disable" {
# Check if the Ultimate Performance plan is installed by GUID
$installedPlan = powercfg -list | Select-String -Pattern "ChrisTitus - Ultimate Power Plan"
if ($installedPlan) {
# Extract the GUID of the installed Ultimate Performance plan
$ultimatePlanGUID = $installedPlan.Line.Split()[3]
# Set a different power plan as active before deleting the Ultimate Performance plan
$balancedPlanGUID = "381b4222-f694-41f0-9685-ff5bb260df2e"
powercfg -setactive $balancedPlanGUID
# Delete the Ultimate Performance plan by GUID
powercfg -delete $ultimatePlanGUID
Write-Host "Ultimate Performance plan has been uninstalled."
Write-Host "> Balanced plan is now active."
} else {
Write-Host "Ultimate Performance plan is not installed."
}
}
default {
Write-Host "Invalid state. Please use 'Enable' or 'Disable'."
}
} }
} catch {
Write-Error "Error occurred: $_"
} }
} }
``` ```

View File

@@ -4,88 +4,27 @@ description: ""
--- ---
```powershell {filename="functions/public/Invoke-WPFUltimatePerformance.ps1",linenos=inline,linenostart=1} ```powershell {filename="functions/public/Invoke-WPFUltimatePerformance.ps1",linenos=inline,linenostart=1}
Function Invoke-WPFUltimatePerformance { function Invoke-WPFUltimatePerformance {
<#
.SYNOPSIS
Enables or disables the Ultimate Performance power scheme based on its GUID.
.PARAMETER State
Specifies whether to "Enable" or "Disable" the Ultimate Performance power scheme.
#>
param( param(
[Parameter(Mandatory = $true)] [switch]$Do
[ValidateSet("Enable", "Disable")]
[string]$State
) )
try { if ($Do) {
# GUID of the Ultimate Performance power plan if (-not (powercfg /list | Select-String "Ultimate Performance")) {
$ultimateGUID = "e9a42b02-d5df-448d-aa00-03f14749eb61" powercfg /setactive ((powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61).Split()[3])
Write-Host "Ultimate Performance plan installed and activated." -ForegroundColor Green
switch ($State) { } else {
"Enable" { Write-Host "Ultimate Performance plan is already installed." -ForegroundColor Red
# Duplicate the Ultimate Performance power plan using its GUID return
$duplicateOutput = powercfg /duplicatescheme $ultimateGUID }
} else {
$guid = $null if (powercfg /list | Select-String "Ultimate Performance") {
$nameFromFile = "ChrisTitus - Ultimate Power Plan" powercfg /setactive SCHEME_BALANCED
$description = "Ultimate Power Plan, added via WinUtils" powercfg /delete ((powercfg /list | Select-String "Ultimate Performance").ToString().Split()[3])
Write-Host "Ultimate Performance plan was removed." -ForegroundColor Red
# Extract the new GUID from the duplicateOutput } else {
foreach ($line in $duplicateOutput) { Write-Host "Ultimate Performance plan is not installed." -ForegroundColor Yellow
if ($line -match "\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b") {
$guid = $matches[0] # $matches[0] will contain the first match, which is the GUID
Write-Output "GUID: $guid has been extracted and stored in the variable."
break
}
}
if (-not $guid) {
Write-Output "No GUID found in the duplicateOutput. Check the output format."
exit 1
}
# Change the name of the power plan and set its description
$changeNameOutput = powercfg /changename $guid "$nameFromFile" "$description"
Write-Output "The power plan name and description have been changed. Output:"
Write-Output $changeNameOutput
# Set the duplicated Ultimate Performance plan as active
$setActiveOutput = powercfg /setactive $guid
Write-Output "The power plan has been set as active. Output:"
Write-Output $setActiveOutput
Write-Host "> Ultimate Performance plan installed and set as active."
}
"Disable" {
# Check if the Ultimate Performance plan is installed by GUID
$installedPlan = powercfg -list | Select-String -Pattern "ChrisTitus - Ultimate Power Plan"
if ($installedPlan) {
# Extract the GUID of the installed Ultimate Performance plan
$ultimatePlanGUID = $installedPlan.Line.Split()[3]
# Set a different power plan as active before deleting the Ultimate Performance plan
$balancedPlanGUID = "381b4222-f694-41f0-9685-ff5bb260df2e"
powercfg -setactive $balancedPlanGUID
# Delete the Ultimate Performance plan by GUID
powercfg -delete $ultimatePlanGUID
Write-Host "Ultimate Performance plan has been uninstalled."
Write-Host "> Balanced plan is now active."
} else {
Write-Host "Ultimate Performance plan is not installed."
}
}
default {
Write-Host "Invalid state. Please use 'Enable' or 'Disable'."
}
} }
} catch {
Write-Error "Error occurred: $_"
} }
} }
``` ```