Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions config/tweaks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2365,6 +2365,118 @@
],
"link": "https://winutil.christitus.com/dev/tweaks/z--advanced-tweaks---caution/disablefso"
},
"WPFTweaksRevertStartMenu": {
"Content": "Revert Start Menu layout",
"Description": "Bring back the old Start Menu layout from before the gradual rollout of the new one in 25H2.",
"category": "z__Advanced Tweaks - CAUTION",
"panel": "1",
"Order": "a027_",
"InvokeScript": [
"
$FEATURE_ID = \"3036241548\"
$BASE_PATH = \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\FeatureManagement\\Overrides\"

$DISABLED = 1

# Set-ItemProperty wrapper to run as TrustedInstaller since Administrators
# only have read access to the specific key by default.
function setKeyValueAsTI {
param(
[string]$registryPath,
$value
)

$COMMAND = \"Set-ItemProperty -Path 'Registry::$registryPath' -Name 'EnabledState' -Value $value -Type DWord -Force -ErrorAction Stop\"

Register-ScheduledTask -TaskName \"ti\" -Action (New-ScheduledTaskAction -Execute \"powershell\" -Argument \"$COMMAND\") -User 'NT SERVICE\\TrustedInstaller' -Force

# Let the task run until it is complete or until 10 seconds pass (fail), whichever comes first
$TIMEOUT = 10
$elapsed = 0
Start-ScheduledTask -TaskName \"ti\"
while ((Get-ScheduledTask -TaskName \"ti\").state -ne \"Ready\" -and $elapsed -lt $TIMEOUT) {
Start-Sleep -Milliseconds 100
$elapsed += 0.1
}

Unregister-ScheduledTask -TaskName \"ti\" -Confirm:$false
if ($elapsed -ge $TIMEOUT) {
throw \"Could not set key value for '$registryPath' as TrustedInstaller\"
}
}

# Check if the feature override exists
$configurationPriority = Get-ChildItem -Path $BASE_PATH | Where-Object {
Test-Path -Path (Join-Path $_.PSPath $FEATURE_ID)
}

if ($configurationPriority) {
Write-Host \"Override found at: $($configurationPriority)\"
$targetPath = Join-Path $configurationPriority $FEATURE_ID

setKeyValueAsTI -registryPath $targetPath -value $DISABLED

Write-Host \"New start menu layout disabled\"
Write-Host \"Please restart your computer for the changes to apply!\" -Foreground Yellow
} else {
Write-Error \"Feature override not present\"
}
"
],
"UndoScript": [
"
$FEATURE_ID = \"3036241548\"
$BASE_PATH = \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\FeatureManagement\\Overrides\"

$ENABLED = 2

# Set-ItemProperty wrapper to run as TrustedInstaller since Administrators
# only have read access to the specific key by default.
function setKeyValueAsTI {
param(
[string]$registryPath,
$value
)

$COMMAND = \"Set-ItemProperty -Path 'Registry::$registryPath' -Name 'EnabledState' -Value $value -Type DWord -Force -ErrorAction Stop\"

Register-ScheduledTask -TaskName \"ti\" -Action (New-ScheduledTaskAction -Execute \"powershell\" -Argument \"$COMMAND\") -User 'NT SERVICE\\TrustedInstaller' -Force

# Let the task run until it is complete or until 10 seconds pass (fail), whichever comes first
$TIMEOUT = 10
$elapsed = 0
Start-ScheduledTask -TaskName \"ti\"
while ((Get-ScheduledTask -TaskName \"ti\").state -ne \"Ready\" -and $elapsed -lt $TIMEOUT) {
Start-Sleep -Milliseconds 100
$elapsed += 0.1
}

Unregister-ScheduledTask -TaskName \"ti\" -Confirm:$false
if ($elapsed -ge $TIMEOUT) {
throw \"Could not set key value for '$registryPath' as TrustedInstaller\"
}
}

# Check if the feature override exists
$configurationPriority = Get-ChildItem -Path $BASE_PATH | Where-Object {
Test-Path -Path (Join-Path $_.PSPath $FEATURE_ID)
}

if ($configurationPriority) {
Write-Host \"Override found at: $($configurationPriority)\"
$targetPath = Join-Path $configurationPriority $FEATURE_ID

setKeyValueAsTI -registryPath $targetPath -value $ENABLED

Write-Host \"New start menu layout re-enabled\"
Write-Host \"Please restart your computer for the changes to apply!\" -Foreground Yellow
} else {
Write-Error \"Feature override not present\"
}
"
],
"link": ""
},
"WPFToggleDarkMode": {
"Content": "Dark Theme for Windows",
"Description": "Enable/Disable Dark Mode.",
Expand Down
Loading