mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-12-22 14:01:31 -06:00
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:
parent
4ea57b0e63
commit
72043ee7d2
@ -10,6 +10,8 @@ Launch Command:
|
|||||||
iwr -useb https://christitus.com/win | iex
|
iwr -useb https://christitus.com/win | iex
|
||||||
```
|
```
|
||||||
|
|
||||||
|
EXE Wrapper for $5 @ https://www.cttstore.com/windows-toolbox
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
- Install
|
- Install
|
||||||
|
195
winutil.ps1
195
winutil.ps1
@ -497,6 +497,10 @@ $WPFinstall.Add_Click({
|
|||||||
|
|
||||||
[System.Windows.MessageBox]::Show($Messageboxbody, $AppTitle, $ButtonType, $MessageIcon)
|
[System.Windows.MessageBox]::Show($Messageboxbody, $AppTitle, $ButtonType, $MessageIcon)
|
||||||
|
|
||||||
|
Write-Host "================================="
|
||||||
|
Write-Host "--- Installs are Finished ---"
|
||||||
|
Write-Host "================================="
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
$WPFInstallUpgrade.Add_Click({
|
$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 "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 "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 "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 "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 "LowLevelHooksTimeout" -Type DWord -Value 1000
|
||||||
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "WaitToKillServiceTimeout" -Type DWord -Value 2000
|
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\CurrentVersion\Explorer\VisualEffects" -Name "VisualFXSetting" -Type DWord -Value 3
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "EnableAeroPeek" -Type DWord -Value 0
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "EnableAeroPeek" -Type DWord -Value 0
|
||||||
Write-Host "Adjusted visual effects for performance"
|
Write-Host "Adjusted visual effects for performance"
|
||||||
$WPFMiscTweaksDisplay.IsChecked = false
|
$WPFMiscTweaksDisplay.IsChecked = $false
|
||||||
}
|
}
|
||||||
|
|
||||||
If ( $WPFEssTweaksDeBloat.IsChecked -eq $true ) {
|
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\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\CurrentVersion\Explorer\VisualEffects" -Name "VisualFXSetting" -Type DWord -Value 3
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "EnableAeroPeek" -Type DWord -Value 1
|
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..."
|
Write-Host "Restoring Clipboard History..."
|
||||||
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Clipboard" -Name "EnableClipboardHistory" -ErrorAction SilentlyContinue
|
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Clipboard" -Name "EnableClipboardHistory" -ErrorAction SilentlyContinue
|
||||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "AllowClipboardHistory" -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
|
$MessageIcon = [System.Windows.MessageBoxImage]::Information
|
||||||
|
|
||||||
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
|
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
|
||||||
|
|
||||||
|
Write-Host "================================="
|
||||||
|
Write-Host "--- Undo All is Finished ---"
|
||||||
|
Write-Host "================================="
|
||||||
})
|
})
|
||||||
#===========================================================================
|
#===========================================================================
|
||||||
# Tab 3 - Config Buttons
|
# Tab 3 - Config Buttons
|
||||||
@ -1286,6 +1295,10 @@ $WPFFeatureInstall.Add_Click({
|
|||||||
$MessageIcon = [System.Windows.MessageBoxImage]::Information
|
$MessageIcon = [System.Windows.MessageBoxImage]::Information
|
||||||
|
|
||||||
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
|
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
|
||||||
|
|
||||||
|
Write-Host "================================="
|
||||||
|
Write-Host "--- Features are Installed ---"
|
||||||
|
Write-Host "================================="
|
||||||
})
|
})
|
||||||
|
|
||||||
$WPFPanelDISM.Add_Click({
|
$WPFPanelDISM.Add_Click({
|
||||||
@ -1319,67 +1332,16 @@ $WPFPaneluser.Add_Click({
|
|||||||
#===========================================================================
|
#===========================================================================
|
||||||
|
|
||||||
$WPFUpdatesdefault.Add_Click({
|
$WPFUpdatesdefault.Add_Click({
|
||||||
# Source: https://github.com/rgl/windows-vagrant/blob/master/disable-windows-updates.ps1 reversed!
|
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
|
||||||
Set-StrictMode -Version Latest
|
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
|
||||||
$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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$null
|
|
||||||
}
|
}
|
||||||
$auPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU'
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoUpdate" -Type DWord -Value 0
|
||||||
New-Directory $auPath
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUOptions" -Type DWord -Value 3
|
||||||
# set NoAutoUpdate.
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
|
||||||
# 0: Automatic Updates is enabled (default).
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Force | Out-Null
|
||||||
# 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 = @(
|
$services = @(
|
||||||
"BITS"
|
"BITS"
|
||||||
"wuauserv"
|
"wuauserv"
|
||||||
@ -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 "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 "DeferFeatureUpdatesPeriodInDays" -ErrorAction SilentlyContinue
|
||||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "DeferQualityUpdatesPeriodInDays " -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({
|
$WPFFixesUpdate.Add_Click({
|
||||||
@ -1413,8 +1378,6 @@ $WPFFixesUpdate.Add_Click({
|
|||||||
Stop-Service -Name wuauserv
|
Stop-Service -Name wuauserv
|
||||||
Stop-Service -Name appidsvc
|
Stop-Service -Name appidsvc
|
||||||
Stop-Service -Name cryptsvc
|
Stop-Service -Name cryptsvc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Write-Host "2. Remove QMGR Data file..."
|
Write-Host "2. Remove QMGR Data file..."
|
||||||
Remove-Item "$env:allusersprofile\Application Data\Microsoft\Network\Downloader\qmgr*.dat" -ErrorAction SilentlyContinue
|
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..."
|
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 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)"
|
"sc.exe sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)"
|
||||||
|
|
||||||
Set-Location $env:systemroot\system32
|
Set-Location $env:systemroot\system32
|
||||||
|
|
||||||
Write-Host "6. Registering some DLLs..."
|
Write-Host "6. Registering some DLLs..."
|
||||||
@ -1478,6 +1440,7 @@ $WPFFixesUpdate.Add_Click({
|
|||||||
Write-Host "8) Resetting the WinSock..."
|
Write-Host "8) Resetting the WinSock..."
|
||||||
netsh winsock reset
|
netsh winsock reset
|
||||||
netsh winhttp reset proxy
|
netsh winhttp reset proxy
|
||||||
|
netsh int ip reset
|
||||||
|
|
||||||
Write-Host "9) Delete all BITS jobs..."
|
Write-Host "9) Delete all BITS jobs..."
|
||||||
Get-BitsTransfer | Remove-BitsTransfer
|
Get-BitsTransfer | Remove-BitsTransfer
|
||||||
@ -1507,82 +1470,37 @@ $WPFFixesUpdate.Add_Click({
|
|||||||
$MessageIcon = [System.Windows.MessageBoxImage]::Information
|
$MessageIcon = [System.Windows.MessageBoxImage]::Information
|
||||||
|
|
||||||
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
|
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
|
||||||
|
Write-Host "================================="
|
||||||
|
Write-Host "-- Reset ALL Updates to Factory -"
|
||||||
|
Write-Host "================================="
|
||||||
})
|
})
|
||||||
|
|
||||||
$WPFUpdatesdisable.Add_Click({
|
$WPFUpdatesdisable.Add_Click({
|
||||||
# Source: https://github.com/rgl/windows-vagrant/blob/master/disable-windows-updates.ps1
|
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
|
||||||
Set-StrictMode -Version Latest
|
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
|
||||||
$ProgressPreference = 'SilentlyContinue'
|
}
|
||||||
$ErrorActionPreference = 'Stop'
|
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
|
||||||
|
}
|
||||||
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 0
|
||||||
|
|
||||||
|
$services = @(
|
||||||
|
"BITS"
|
||||||
|
"wuauserv"
|
||||||
|
)
|
||||||
|
|
||||||
# disable automatic updates.
|
foreach ($service in $services) {
|
||||||
# XXX this does not seem to work anymore.
|
# -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist
|
||||||
# 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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$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.
|
Write-Host "Setting $service StartupType to Disabled"
|
||||||
# NB this applies to Windows 10.
|
Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Disabled
|
||||||
# 0: Disabled
|
}
|
||||||
# 1: PCs on my local network
|
Write-Host "================================="
|
||||||
# 3: PCs on my local network, and PCs on the Internet
|
Write-Host "--- Updates ARE DISABLED ---"
|
||||||
$deliveryOptimizationPath = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config'
|
Write-Host "================================="
|
||||||
If (Test-Path $deliveryOptimizationPath) {
|
})
|
||||||
New-ItemProperty `
|
|
||||||
-Path $deliveryOptimizationPath `
|
|
||||||
-Name DODownloadMode `
|
|
||||||
-Value 0 `
|
|
||||||
-PropertyType DWORD `
|
|
||||||
-Force `
|
|
||||||
| Out-Null
|
|
||||||
}
|
|
||||||
# Service tweaks for Windows Update
|
|
||||||
|
|
||||||
$services = @(
|
|
||||||
"BITS"
|
|
||||||
"wuauserv"
|
|
||||||
)
|
|
||||||
|
|
||||||
foreach ($service in $services) {
|
|
||||||
# -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist
|
|
||||||
|
|
||||||
Write-Host "Setting $service StartupType to Disabled"
|
|
||||||
Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Disabled
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
$WPFUpdatessecurity.Add_Click({
|
$WPFUpdatessecurity.Add_Click({
|
||||||
Write-Host "Disabling driver offering through Windows Update..."
|
Write-Host "Disabling driver offering through Windows Update..."
|
||||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata")) {
|
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata")) {
|
||||||
@ -1616,6 +1534,9 @@ $WPFUpdatessecurity.Add_Click({
|
|||||||
$MessageIcon = [System.Windows.MessageBoxImage]::Information
|
$MessageIcon = [System.Windows.MessageBoxImage]::Information
|
||||||
|
|
||||||
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
|
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
|
||||||
|
Write-Host "================================="
|
||||||
|
Write-Host "-- Updates Set to Recommended ---"
|
||||||
|
Write-Host "================================="
|
||||||
})
|
})
|
||||||
|
|
||||||
#===========================================================================
|
#===========================================================================
|
||||||
|
Loading…
Reference in New Issue
Block a user