Fix invalid flag value after applying misc tweaks (#141)

* Update README.md

* QOL Terminal - Win Update Revamp

* Fix Flickering

* Fix invalid flag value after applying misc tweaks

Adjusting visual effects for performance...
Adjusted visual effects for performance
false:
Line |
 964 |              $WPFMiscTweaksDisplay.IsChecked = false
     |                                                ~~~~~
     | The term 'false' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Co-authored-by: Chris Titus <dfm.titus@gmail.com>
This commit is contained in:
Joaquín 2022-09-15 12:50:38 -03:00 committed by GitHub
parent 4ea57b0e63
commit 72043ee7d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 60 additions and 137 deletions

View File

@ -10,6 +10,8 @@ Launch Command:
iwr -useb https://christitus.com/win | iex
```
EXE Wrapper for $5 @ https://www.cttstore.com/windows-toolbox
## Overview
- Install

View File

@ -497,6 +497,10 @@ $WPFinstall.Add_Click({
[System.Windows.MessageBox]::Show($Messageboxbody, $AppTitle, $ButtonType, $MessageIcon)
Write-Host "================================="
Write-Host "--- Installs are Finished ---"
Write-Host "================================="
})
$WPFInstallUpgrade.Add_Click({
@ -861,7 +865,8 @@ $WPFtweaksbutton.Add_Click({
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control" -Name "WaitToKillServiceTimeout" -Type DWord -Value 2000
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "MenuShowDelay" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "WaitToKillAppTimeout" -Type DWord -Value 5000
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "HungAppTimeout" -Type DWord -Value 4000
Remove-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "HungAppTimeout" -ErrorAction SilentlyContinue
# Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "HungAppTimeout" -Type DWord -Value 4000 # Note: This caused flickering
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "AutoEndTasks" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "LowLevelHooksTimeout" -Type DWord -Value 1000
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "WaitToKillServiceTimeout" -Type DWord -Value 2000
@ -970,7 +975,7 @@ $WPFtweaksbutton.Add_Click({
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" -Name "VisualFXSetting" -Type DWord -Value 3
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "EnableAeroPeek" -Type DWord -Value 0
Write-Host "Adjusted visual effects for performance"
$WPFMiscTweaksDisplay.IsChecked = false
$WPFMiscTweaksDisplay.IsChecked = $false
}
If ( $WPFEssTweaksDeBloat.IsChecked -eq $true ) {
@ -1222,7 +1227,7 @@ $WPFundoall.Add_Click({
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarAnimations" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" -Name "VisualFXSetting" -Type DWord -Value 3
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "EnableAeroPeek" -Type DWord -Value 1
Remove-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "HungAppTimeout" -ErrorAction SilentlyContinue
Write-Host "Restoring Clipboard History..."
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Clipboard" -Name "EnableClipboardHistory" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "AllowClipboardHistory" -ErrorAction SilentlyContinue
@ -1236,6 +1241,10 @@ $WPFundoall.Add_Click({
$MessageIcon = [System.Windows.MessageBoxImage]::Information
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
Write-Host "================================="
Write-Host "--- Undo All is Finished ---"
Write-Host "================================="
})
#===========================================================================
# Tab 3 - Config Buttons
@ -1286,6 +1295,10 @@ $WPFFeatureInstall.Add_Click({
$MessageIcon = [System.Windows.MessageBoxImage]::Information
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
Write-Host "================================="
Write-Host "--- Features are Installed ---"
Write-Host "================================="
})
$WPFPanelDISM.Add_Click({
@ -1319,66 +1332,15 @@ $WPFPaneluser.Add_Click({
#===========================================================================
$WPFUpdatesdefault.Add_Click({
# Source: https://github.com/rgl/windows-vagrant/blob/master/disable-windows-updates.ps1 reversed!
Set-StrictMode -Version Latest
$ProgressPreference = 'SilentlyContinue'
$ErrorActionPreference = 'Stop'
# disable automatic updates.
# XXX this does not seem to work anymore.
# see How to configure automatic updates by using Group Policy or registry settings
# at https://support.microsoft.com/en-us/help/328010
function New-Directory($path) {
$p, $components = $path -split '[\\/]'
$components | ForEach-Object {
$p = "$p\$_"
If (!(Test-Path $p)) {
New-Item -ItemType Directory $p | Out-Null
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoUpdate" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUOptions" -Type DWord -Value 3
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Force | Out-Null
}
$null
}
$auPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU'
New-Directory $auPath
# set NoAutoUpdate.
# 0: Automatic Updates is enabled (default).
# 1: Automatic Updates is disabled.
New-ItemProperty `
-Path $auPath `
-Name NoAutoUpdate `
-Value 0 `
-PropertyType DWORD `
-Force `
| Out-Null
# set AUOptions.
# 1: Keep my computer up to date has been disabled in Automatic Updates.
# 2: Notify of download and installation.
# 3: Automatically download and notify of installation.
# 4: Automatically download and scheduled installation.
New-ItemProperty `
-Path $auPath `
-Name AUOptions `
-Value 3 `
-PropertyType DWORD `
-Force `
| Out-Null
# disable Windows Update Delivery Optimization.
# NB this applies to Windows 10.
# 0: Disabled
# 1: PCs on my local network
# 3: PCs on my local network, and PCs on the Internet
$deliveryOptimizationPath = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config'
If (Test-Path $deliveryOptimizationPath) {
New-ItemProperty `
-Path $deliveryOptimizationPath `
-Name DODownloadMode `
-Value 0 `
-PropertyType DWORD `
-Force `
| Out-Null
}
# Service tweaks for Windows Update
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1
$services = @(
"BITS"
@ -1404,6 +1366,9 @@ $WPFUpdatesdefault.Add_Click({
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "BranchReadinessLevel" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "DeferFeatureUpdatesPeriodInDays" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "DeferQualityUpdatesPeriodInDays " -ErrorAction SilentlyContinue
Write-Host "================================="
Write-Host "--- Updates Set to Default ---"
Write-Host "================================="
})
$WPFFixesUpdate.Add_Click({
@ -1414,8 +1379,6 @@ $WPFFixesUpdate.Add_Click({
Stop-Service -Name appidsvc
Stop-Service -Name cryptsvc
Write-Host "2. Remove QMGR Data file..."
Remove-Item "$env:allusersprofile\Application Data\Microsoft\Network\Downloader\qmgr*.dat" -ErrorAction SilentlyContinue
@ -1429,7 +1392,6 @@ $WPFFixesUpdate.Add_Click({
Write-Host "5. Resetting the Windows Update Services to defualt settings..."
"sc.exe sdset bits D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)"
"sc.exe sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)"
Set-Location $env:systemroot\system32
Write-Host "6. Registering some DLLs..."
@ -1478,6 +1440,7 @@ $WPFFixesUpdate.Add_Click({
Write-Host "8) Resetting the WinSock..."
netsh winsock reset
netsh winhttp reset proxy
netsh int ip reset
Write-Host "9) Delete all BITS jobs..."
Get-BitsTransfer | Remove-BitsTransfer
@ -1507,68 +1470,21 @@ $WPFFixesUpdate.Add_Click({
$MessageIcon = [System.Windows.MessageBoxImage]::Information
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
Write-Host "================================="
Write-Host "-- Reset ALL Updates to Factory -"
Write-Host "================================="
})
$WPFUpdatesdisable.Add_Click({
# Source: https://github.com/rgl/windows-vagrant/blob/master/disable-windows-updates.ps1
Set-StrictMode -Version Latest
$ProgressPreference = 'SilentlyContinue'
$ErrorActionPreference = 'Stop'
# disable automatic updates.
# XXX this does not seem to work anymore.
# see How to configure automatic updates by using Group Policy or registry settings
# at https://support.microsoft.com/en-us/help/328010
function New-Directory($path) {
$p, $components = $path -split '[\\/]'
$components | ForEach-Object {
$p = "$p\$_"
If (!(Test-Path $p)) {
New-Item -ItemType Directory $p | Out-Null
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoUpdate" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUOptions" -Type DWord -Value 1
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Force | Out-Null
}
$null
}
$auPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU'
New-Directory $auPath
# set NoAutoUpdate.
# 0: Automatic Updates is enabled (default).
# 1: Automatic Updates is disabled.
New-ItemProperty `
-Path $auPath `
-Name NoAutoUpdate `
-Value 1 `
-PropertyType DWORD `
-Force `
| Out-Null
# set AUOptions.
# 1: Keep my computer up to date has been disabled in Automatic Updates.
# 2: Notify of download and installation.
# 3: Automatically download and notify of installation.
# 4: Automatically download and scheduled installation.
New-ItemProperty `
-Path $auPath `
-Name AUOptions `
-Value 1 `
-PropertyType DWORD `
-Force `
| Out-Null
# disable Windows Update Delivery Optimization.
# NB this applies to Windows 10.
# 0: Disabled
# 1: PCs on my local network
# 3: PCs on my local network, and PCs on the Internet
$deliveryOptimizationPath = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config'
If (Test-Path $deliveryOptimizationPath) {
New-ItemProperty `
-Path $deliveryOptimizationPath `
-Name DODownloadMode `
-Value 0 `
-PropertyType DWORD `
-Force `
| Out-Null
}
# Service tweaks for Windows Update
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 0
$services = @(
"BITS"
@ -1581,7 +1497,9 @@ $WPFUpdatesdisable.Add_Click({
Write-Host "Setting $service StartupType to Disabled"
Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Disabled
}
Write-Host "================================="
Write-Host "--- Updates ARE DISABLED ---"
Write-Host "================================="
})
$WPFUpdatessecurity.Add_Click({
Write-Host "Disabling driver offering through Windows Update..."
@ -1616,6 +1534,9 @@ $WPFUpdatessecurity.Add_Click({
$MessageIcon = [System.Windows.MessageBoxImage]::Information
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
Write-Host "================================="
Write-Host "-- Updates Set to Recommended ---"
Write-Host "================================="
})
#===========================================================================