From 98a0e19abb8c5596757ad0e0728f4e88ed6efdb6 Mon Sep 17 00:00:00 2001 From: Carterpersall Date: Fri, 22 Apr 2022 16:21:20 -0500 Subject: [PATCH 01/12] Some Formatting Improvements --- win10debloat.ps1 | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/win10debloat.ps1 b/win10debloat.ps1 index 741c1fc3..130bda08 100644 --- a/win10debloat.ps1 +++ b/win10debloat.ps1 @@ -893,12 +893,14 @@ $essentialtweaks.Add_Click({ Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\Consolidator" | Out-Null Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" | Out-Null Disable-ScheduledTask -TaskName "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" | Out-Null + Write-Host "Disabling Wi-Fi Sense..." If (!(Test-Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) { New-Item -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Force | Out-Null } Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 0 Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 0 + Write-Host "Disabling Application suggestions..." Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "ContentDeliveryAllowed" -Type DWord -Value 0 Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "OemPreInstalledAppsEnabled" -Type DWord -Value 0 @@ -914,10 +916,12 @@ $essentialtweaks.Add_Click({ New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Force | Out-Null } Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 1 + Write-Host "Disabling Activity History..." Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableActivityFeed" -Type DWord -Value 0 Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "PublishUserActivities" -Type DWord -Value 0 Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "UploadUserActivities" -Type DWord -Value 0 + # Keep Location Tracking commented out if you want the ability to locate your device Write-Host "Disabling Location Tracking..." If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location")) { @@ -926,8 +930,10 @@ $essentialtweaks.Add_Click({ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Type String -Value "Deny" Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 0 Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 0 + Write-Host "Disabling automatic Maps updates..." Set-ItemProperty -Path "HKLM:\SYSTEM\Maps" -Name "AutoUpdateEnabled" -Type DWord -Value 0 + Write-Host "Disabling Feedback..." If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) { New-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Force | Out-Null @@ -936,44 +942,56 @@ $essentialtweaks.Add_Click({ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "DoNotShowFeedbackNotifications" -Type DWord -Value 1 Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClient" -ErrorAction SilentlyContinue | Out-Null Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload" -ErrorAction SilentlyContinue | Out-Null + Write-Host "Disabling Tailored Experiences..." If (!(Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) { New-Item -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Force | Out-Null } Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableTailoredExperiencesWithDiagnosticData" -Type DWord -Value 1 + Write-Host "Disabling Advertising ID..." If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo")) { New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" | Out-Null } Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Name "DisabledByGroupPolicy" -Type DWord -Value 1 + Write-Host "Disabling Error reporting..." Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name "Disabled" -Type DWord -Value 1 Disable-ScheduledTask -TaskName "Microsoft\Windows\Windows Error Reporting\QueueReporting" | Out-Null + Write-Host "Restricting Windows Update P2P only to local network..." If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) { New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" | Out-Null } Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1 + Write-Host "Stopping and disabling Diagnostics Tracking Service..." Stop-Service "DiagTrack" -WarningAction SilentlyContinue Set-Service "DiagTrack" -StartupType Disabled + Write-Host "Stopping and disabling WAP Push Service..." Stop-Service "dmwappushservice" -WarningAction SilentlyContinue Set-Service "dmwappushservice" -StartupType Disabled + Write-Host "Enabling F8 boot menu options..." bcdedit /set `{current`} bootmenupolicy Legacy | Out-Null + Write-Host "Stopping and disabling Home Groups services..." Stop-Service "HomeGroupListener" -WarningAction SilentlyContinue Set-Service "HomeGroupListener" -StartupType Disabled Stop-Service "HomeGroupProvider" -WarningAction SilentlyContinue Set-Service "HomeGroupProvider" -StartupType Disabled + Write-Host "Disabling Remote Assistance..." Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 0 + Write-Host "Disabling Storage Sense..." Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy" -Recurse -ErrorAction SilentlyContinue + Write-Host "Stopping and disabling Superfetch service..." Stop-Service "SysMain" -WarningAction SilentlyContinue Set-Service "SysMain" -StartupType Disabled + Write-Host "Disabling Hibernation..." Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Session Manager\Power" -Name "HibernteEnabled" -Type Dword -Value 0 If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings")) { @@ -991,20 +1009,25 @@ $essentialtweaks.Add_Click({ $preferences.Preferences[28] = 0 Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Name "Preferences" -Type Binary -Value $preferences.Preferences } else {Write-Host "Task Manager patch not run in builds 22557+ due to bug"} + Write-Host "Showing file operations details..." If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager")) { New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" | Out-Null } Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" -Name "EnthusiastMode" -Type DWord -Value 1 + Write-Host "Hiding Task View button..." Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Type DWord -Value 0 + Write-Host "Hiding People icon..." If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People")) { New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" | Out-Null } Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" -Name "PeopleBand" -Type DWord -Value 0 + Write-Host "Hide tray icons..." Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -Type DWord -Value 1 + Write-Host "Enabling NumLock after startup..." If (!(Test-Path "HKU:")) { New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null @@ -1063,7 +1086,7 @@ $essentialtweaks.Add_Click({ # Remove "News and Interest" from taskbar Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds" -Name "ShellFeedsTaskbarViewMode" -Type DWord -Value 2 - # remove "Meet Now" button from taskbar + # Remove "Meet Now" button from taskbar If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer")) { New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Force | Out-Null From eba2013df3db921a2553c7bd1d5a5d521e7e31a1 Mon Sep 17 00:00:00 2001 From: Carterpersall Date: Fri, 22 Apr 2022 22:38:15 -0500 Subject: [PATCH 02/12] More Space and $services comments --- win10debloat.ps1 | 106 +++++++++++++++++++++++------------------------ 1 file changed, 51 insertions(+), 55 deletions(-) diff --git a/win10debloat.ps1 b/win10debloat.ps1 index 130bda08..d33d0c82 100644 --- a/win10debloat.ps1 +++ b/win10debloat.ps1 @@ -1069,7 +1069,6 @@ $essentialtweaks.Add_Click({ Set-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Services\Ndu" -Name "Start" -Type DWord -Value 00000004 Set-ItemProperty -Path "HKLM:\Control Panel\Mouse" -Name "MouseHoverTime" -Type DWord -Value 00000010 - # Network Tweaks Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "IRPStackSize" -Type DWord -Value 20 @@ -1087,12 +1086,10 @@ $essentialtweaks.Add_Click({ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds" -Name "ShellFeedsTaskbarViewMode" -Type DWord -Value 2 # Remove "Meet Now" button from taskbar - If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer")) { New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Force | Out-Null } - -Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "HideSCAMeetNow" -Type DWord -Value 1 + Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "HideSCAMeetNow" -Type DWord -Value 1 Write-Host "Removing AutoLogger file and restricting directory..." $autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger" @@ -1109,7 +1106,6 @@ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 0 # Service tweaks to Manual - $services = @( "diagnosticshub.standardcollector.service" # Microsoft (R) Diagnostics Hub Standard Collector Service "DiagTrack" # Diagnostics Tracking Service @@ -1122,64 +1118,64 @@ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies "RemoteRegistry" # Remote Registry "SharedAccess" # Internet Connection Sharing (ICS) "TrkWks" # Distributed Link Tracking Client - #"WbioSrvc" # Windows Biometric Service (required for Fingerprint reader / facial detection) - #"WlanSvc" # WLAN AutoConfig + #"WbioSrvc" # Windows Biometric Service (required for Fingerprint reader / facial detection) + #"WlanSvc" # WLAN AutoConfig "WMPNetworkSvc" # Windows Media Player Network Sharing Service - #"wscsvc" # Windows Security Center Service + #"wscsvc" # Windows Security Center Service "WSearch" # Windows Search "XblAuthManager" # Xbox Live Auth Manager "XblGameSave" # Xbox Live Game Save Service "XboxNetApiSvc" # Xbox Live Networking Service - "XboxGipSvc" #Disables Xbox Accessory Management Service + "XboxGipSvc" # Disables Xbox Accessory Management Service "ndu" # Windows Network Data Usage Monitor - "WerSvc" #disables windows error reporting - #"Spooler" #Disables your printer - "Fax" #Disables fax - "fhsvc" #Disables fax histroy - "gupdate" #Disables google update - "gupdatem" #Disable another google update - "stisvc" #Disables Windows Image Acquisition (WIA) - "AJRouter" #Disables (needed for AllJoyn Router Service) + "WerSvc" # Disables windows error reporting + #"Spooler" # Disables your printer + "Fax" # Disables fax + "fhsvc" # Disables fax histroy + "gupdate" # Disables google update + "gupdatem" # Disable another google update + "stisvc" # Disables Windows Image Acquisition (WIA) + "AJRouter" # Disables (needed for AllJoyn Router Service) "MSDTC" # Disables Distributed Transaction Coordinator - "WpcMonSvc" #Disables Parental Controls - "PhoneSvc" #Disables Phone Service(Manages the telephony state on the device) - "PrintNotify" #Disables Windows printer notifications and extentions - "PcaSvc" #Disables Program Compatibility Assistant Service - "WPDBusEnum" #Disables Portable Device Enumerator Service - #"LicenseManager" #Disable LicenseManager(Windows store may not work properly) - "seclogon" #Disables Secondary Logon(disables other credentials only password will work) - "SysMain" #Disables sysmain - "lmhosts" #Disables TCP/IP NetBIOS Helper - "wisvc" #Disables Windows Insider program(Windows Insider will not work) - "FontCache" #Disables Windows font cache - "RetailDemo" #Disables RetailDemo whic is often used when showing your device + "WpcMonSvc" # Disables Parental Controls + "PhoneSvc" # Disables Phone Service(Manages the telephony state on the device) + "PrintNotify" # Disables Windows printer notifications and extentions + "PcaSvc" # Disables Program Compatibility Assistant Service + "WPDBusEnum" # Disables Portable Device Enumerator Service + #"LicenseManager" # Disable LicenseManager(Windows store may not work properly) + "seclogon" # Disables Secondary Logon(disables other credentials only password will work) + "SysMain" # Disables sysmain + "lmhosts" # Disables TCP/IP NetBIOS Helper + "wisvc" # Disables Windows Insider program(Windows Insider will not work) + "FontCache" # Disables Windows font cache + "RetailDemo" # Disables RetailDemo whic is often used when showing your device "ALG" # Disables Application Layer Gateway Service(Provides support for 3rd party protocol plug-ins for Internet Connection Sharing) - #"BFE" #Disables Base Filtering Engine (BFE) (is a service that manages firewall and Internet Protocol security) - #"BrokerInfrastructure" #Disables Windows infrastructure service that controls which background tasks can run on the system. - "SCardSvr" #Disables Windows smart card - "EntAppSvc" #Disables enterprise application management. - "BthAvctpSvc" #Disables AVCTP service (if you use Bluetooth Audio Device or Wireless Headphones. then don't disable this) - #"FrameServer" #Disables Windows Camera Frame Server(this allows multiple clients to access video frames from camera devices.) - "Browser" #Disables computer browser - "BthAvctpSvc" #AVCTP service (This is Audio Video Control Transport Protocol service.) - #"BDESVC" #Disables bitlocker - "iphlpsvc" #Disables ipv6 but most websites don't use ipv6 they use ipv4 - "edgeupdate" # Disables one of edge update service - "MicrosoftEdgeElevationService" # Disables one of edge service - "edgeupdatem" # disbales another one of update service (disables edgeupdatem) - "SEMgrSvc" #Disables Payments and NFC/SE Manager (Manages payments and Near Field Communication (NFC) based secure elements) - #"PNRPsvc" # Disables peer Name Resolution Protocol ( some peer-to-peer and collaborative applications, such as Remote Assistance, may not function, Discord will still work) - #"p2psvc" # Disbales Peer Name Resolution Protocol(nables multi-party communication using Peer-to-Peer Grouping. If disabled, some applications, such as HomeGroup, may not function. Discord will still work) - #"p2pimsvc" # Disables Peer Networking Identity Manager (Peer-to-Peer Grouping services may not function, and some applications, such as HomeGroup and Remote Assistance, may not function correctly.Discord will still work) - "PerfHost" #Disables remote users and 64-bit processes to query performance . - "BcastDVRUserService_48486de" #Disables GameDVR and Broadcast is used for Game Recordings and Live Broadcasts - "CaptureService_48486de" #Disables ptional screen capture functionality for applications that call the Windows.Graphics.Capture API. - "cbdhsvc_48486de" #Disables cbdhsvc_48486de (clipboard service it disables) - #"BluetoothUserService_48486de" #disbales BluetoothUserService_48486de (The Bluetooth user service supports proper functionality of Bluetooth features relevant to each user session.) - "WpnService" #Disables WpnService (Push Notifications may not work ) - #"StorSvc" #Disables StorSvc (usb external hard drive will not be reconised by windows) - "RtkBtManServ" #Disables Realtek Bluetooth Device Manager Service - "QWAVE" #Disables Quality Windows Audio Video Experience (audio and video might sound worse) + #"BFE" # Disables Base Filtering Engine (BFE) (is a service that manages firewall and Internet Protocol security) + #"BrokerInfrastructure" # Disables Windows infrastructure service that controls which background tasks can run on the system. + "SCardSvr" # Disables Windows smart card + "EntAppSvc" # Disables enterprise application management. + "BthAvctpSvc" # Disables AVCTP service (if you use Bluetooth Audio Device or Wireless Headphones. then don't disable this) + #"FrameServer" # Disables Windows Camera Frame Server(this allows multiple clients to access video frames from camera devices.) + "Browser" # Disables computer browser + "BthAvctpSvc" # AVCTP service (This is Audio Video Control Transport Protocol service.) + #"BDESVC" # Disables bitlocker + "iphlpsvc" # Disables ipv6 but most websites don't use ipv6 they use ipv4 + "edgeupdate" # Disables one of edge update service + "MicrosoftEdgeElevationService" # Disables one of edge service + "edgeupdatem" # Disbales another one of update service (disables edgeupdatem) + "SEMgrSvc" # Disables Payments and NFC/SE Manager (Manages payments and Near Field Communication (NFC) based secure elements) + #"PNRPsvc" # Disables peer Name Resolution Protocol ( some peer-to-peer and collaborative applications, such as Remote Assistance, may not function, Discord will still work) + #"p2psvc" # Disbales Peer Name Resolution Protocol(nables multi-party communication using Peer-to-Peer Grouping. If disabled, some applications, such as HomeGroup, may not function. Discord will still work) + #"p2pimsvc" # Disables Peer Networking Identity Manager (Peer-to-Peer Grouping services may not function, and some applications, such as HomeGroup and Remote Assistance, may not function correctly.Discord will still work) + "PerfHost" # Disables remote users and 64-bit processes to query performance . + "BcastDVRUserService_48486de" # Disables GameDVR and Broadcast is used for Game Recordings and Live Broadcasts + "CaptureService_48486de" # Disables ptional screen capture functionality for applications that call the Windows.Graphics.Capture API. + "cbdhsvc_48486de" # Disables cbdhsvc_48486de (clipboard service it disables) + #"BluetoothUserService_48486de" # disbales BluetoothUserService_48486de (The Bluetooth user service supports proper functionality of Bluetooth features relevant to each user session.) + "WpnService" # Disables WpnService (Push Notifications may not work ) + #"StorSvc" # Disables StorSvc (usb external hard drive will not be reconised by windows) + "RtkBtManServ" # Disables Realtek Bluetooth Device Manager Service + "QWAVE" # Disables Quality Windows Audio Video Experience (audio and video might sound worse) #Hp services "HPAppHelperCap" "HPDiagsCap" From 68061f8e2200925202c0e70cc555b635361f3bd6 Mon Sep 17 00:00:00 2001 From: Carterpersall Date: Fri, 22 Apr 2022 22:50:46 -0500 Subject: [PATCH 03/12] Sort $services and $Bloatware alphabetically --- win10debloat.ps1 | 235 +++++++++++++++++++++++------------------------ 1 file changed, 116 insertions(+), 119 deletions(-) diff --git a/win10debloat.ps1 b/win10debloat.ps1 index d33d0c82..89a17d5f 100644 --- a/win10debloat.ps1 +++ b/win10debloat.ps1 @@ -1107,92 +1107,91 @@ $essentialtweaks.Add_Click({ # Service tweaks to Manual $services = @( - "diagnosticshub.standardcollector.service" # Microsoft (R) Diagnostics Hub Standard Collector Service - "DiagTrack" # Diagnostics Tracking Service - "DPS" - "dmwappushservice" # WAP Push Message Routing Service (see known issues) - "lfsvc" # Geolocation Service - "MapsBroker" # Downloaded Maps Manager - "NetTcpPortSharing" # Net.Tcp Port Sharing Service - "RemoteAccess" # Routing and Remote Access - "RemoteRegistry" # Remote Registry - "SharedAccess" # Internet Connection Sharing (ICS) - "TrkWks" # Distributed Link Tracking Client - #"WbioSrvc" # Windows Biometric Service (required for Fingerprint reader / facial detection) - #"WlanSvc" # WLAN AutoConfig - "WMPNetworkSvc" # Windows Media Player Network Sharing Service - #"wscsvc" # Windows Security Center Service - "WSearch" # Windows Search - "XblAuthManager" # Xbox Live Auth Manager - "XblGameSave" # Xbox Live Game Save Service - "XboxNetApiSvc" # Xbox Live Networking Service - "XboxGipSvc" # Disables Xbox Accessory Management Service - "ndu" # Windows Network Data Usage Monitor - "WerSvc" # Disables windows error reporting - #"Spooler" # Disables your printer - "Fax" # Disables fax - "fhsvc" # Disables fax histroy - "gupdate" # Disables google update - "gupdatem" # Disable another google update - "stisvc" # Disables Windows Image Acquisition (WIA) - "AJRouter" # Disables (needed for AllJoyn Router Service) - "MSDTC" # Disables Distributed Transaction Coordinator - "WpcMonSvc" # Disables Parental Controls - "PhoneSvc" # Disables Phone Service(Manages the telephony state on the device) - "PrintNotify" # Disables Windows printer notifications and extentions - "PcaSvc" # Disables Program Compatibility Assistant Service - "WPDBusEnum" # Disables Portable Device Enumerator Service - #"LicenseManager" # Disable LicenseManager(Windows store may not work properly) - "seclogon" # Disables Secondary Logon(disables other credentials only password will work) - "SysMain" # Disables sysmain - "lmhosts" # Disables TCP/IP NetBIOS Helper - "wisvc" # Disables Windows Insider program(Windows Insider will not work) - "FontCache" # Disables Windows font cache - "RetailDemo" # Disables RetailDemo whic is often used when showing your device - "ALG" # Disables Application Layer Gateway Service(Provides support for 3rd party protocol plug-ins for Internet Connection Sharing) - #"BFE" # Disables Base Filtering Engine (BFE) (is a service that manages firewall and Internet Protocol security) - #"BrokerInfrastructure" # Disables Windows infrastructure service that controls which background tasks can run on the system. - "SCardSvr" # Disables Windows smart card - "EntAppSvc" # Disables enterprise application management. - "BthAvctpSvc" # Disables AVCTP service (if you use Bluetooth Audio Device or Wireless Headphones. then don't disable this) - #"FrameServer" # Disables Windows Camera Frame Server(this allows multiple clients to access video frames from camera devices.) - "Browser" # Disables computer browser - "BthAvctpSvc" # AVCTP service (This is Audio Video Control Transport Protocol service.) - #"BDESVC" # Disables bitlocker - "iphlpsvc" # Disables ipv6 but most websites don't use ipv6 they use ipv4 - "edgeupdate" # Disables one of edge update service - "MicrosoftEdgeElevationService" # Disables one of edge service - "edgeupdatem" # Disbales another one of update service (disables edgeupdatem) - "SEMgrSvc" # Disables Payments and NFC/SE Manager (Manages payments and Near Field Communication (NFC) based secure elements) - #"PNRPsvc" # Disables peer Name Resolution Protocol ( some peer-to-peer and collaborative applications, such as Remote Assistance, may not function, Discord will still work) - #"p2psvc" # Disbales Peer Name Resolution Protocol(nables multi-party communication using Peer-to-Peer Grouping. If disabled, some applications, such as HomeGroup, may not function. Discord will still work) - #"p2pimsvc" # Disables Peer Networking Identity Manager (Peer-to-Peer Grouping services may not function, and some applications, such as HomeGroup and Remote Assistance, may not function correctly.Discord will still work) - "PerfHost" # Disables remote users and 64-bit processes to query performance . - "BcastDVRUserService_48486de" # Disables GameDVR and Broadcast is used for Game Recordings and Live Broadcasts - "CaptureService_48486de" # Disables ptional screen capture functionality for applications that call the Windows.Graphics.Capture API. - "cbdhsvc_48486de" # Disables cbdhsvc_48486de (clipboard service it disables) - #"BluetoothUserService_48486de" # disbales BluetoothUserService_48486de (The Bluetooth user service supports proper functionality of Bluetooth features relevant to each user session.) - "WpnService" # Disables WpnService (Push Notifications may not work ) - #"StorSvc" # Disables StorSvc (usb external hard drive will not be reconised by windows) - "RtkBtManServ" # Disables Realtek Bluetooth Device Manager Service - "QWAVE" # Disables Quality Windows Audio Video Experience (audio and video might sound worse) - #Hp services - "HPAppHelperCap" - "HPDiagsCap" - "HPNetworkCap" - "HPSysInfoCap" - "HpTouchpointAnalyticsService" - #hyper-v services - "HvHost" - "vmickvpexchange" - "vmicguestinterface" - "vmicshutdown" - "vmicheartbeat" - "vmicvmsession" - "vmicrdv" - "vmictimesync" - # Services which cannot be disabled - #"WdNisSvc" + "ALG" # Application Layer Gateway Service(Provides support for 3rd party protocol plug-ins for Internet Connection Sharing) + "AJRouter" # Needed for AllJoyn Router Service + "BcastDVRUserService_48486de" # GameDVR and Broadcast is used for Game Recordings and Live Broadcasts + #"BDESVC" # Bitlocker Drive Encryption Service + #"BFE" # Base Filtering Engine (Manages Firewall and Internet Protocol security) + #"BluetoothUserService_48486de" # Bluetooth user service supports proper functionality of Bluetooth features relevant to each user session. + #"BrokerInfrastructure" # Windows Infrastructure Service (Controls which background tasks can run on the system) + "Browser" # Let users browse and locate shared resources in neighboring computers + "BthAvctpSvc" # AVCTP service (needed for Bluetooth Audio Devices or Wireless Headphones) + "CaptureService_48486de" # Optional screen capture functionality for applications that call the Windows.Graphics.Capture API. + "cbdhsvc_48486de" # Clipboard Service + "diagnosticshub.standardcollector.service" # Microsoft (R) Diagnostics Hub Standard Collector Service + "DiagTrack" # Diagnostics Tracking Service + "dmwappushservice" # WAP Push Message Routing Service + "DPS" # Diagnostic Policy Service (Detects and Troubleshoots Potential Problems) + "edgeupdate" # Edge Update Service + "edgeupdatem" # Another Update Service + "EntAppSvc" # Enterprise Application Management. + "Fax" # Fax Service + "fhsvc" # Fax History + "FontCache" # Windows font cache + #"FrameServer" # Windows Camera Frame Server (Allows multiple clients to access video frames from camera devices) + "gupdate" # Google Update + "gupdatem" # Another Google Update Service + "iphlpsvc" # ipv6(Most websites use ipv4 instead) + "lfsvc" # Geolocation Service + #"LicenseManager" # Disable LicenseManager (Windows Store may not work properly) + "lmhosts" # TCP/IP NetBIOS Helper + "MapsBroker" # Downloaded Maps Manager + "MicrosoftEdgeElevationService" # Another Edge Update Service + "MSDTC" # Distributed Transaction Coordinator + #"ndu" # Windows Network Data Usage Monitor (Disabling Breaks Task Manager Per-Process Network Monitoring) + "NetTcpPortSharing" # Net.Tcp Port Sharing Service + "PcaSvc" # Program Compatibility Assistant Service + "PerfHost" # Remote users and 64-bit processes to query performance. + "PhoneSvc" # Phone Service(Manages the telephony state on the device) + #"PNRPsvc" # Peer Name Resolution Protocol (Some peer-to-peer and collaborative applications, such as Remote Assistance, may not function, Discord will still work) + #"p2psvc" # Peer Name Resolution Protocol(Enables multi-party communication using Peer-to-Peer Grouping. If disabled, some applications, such as HomeGroup, may not function. Discord will still work)iscord will still work) + #"p2pimsvc" # Peer Networking Identity Manager (Peer-to-Peer Grouping services may not function, and some applications, such as HomeGroup and Remote Assistance, may not function correctly. Discord will still work) + "PrintNotify" # Windows printer notifications and extentions + "QWAVE" # Quality Windows Audio Video Experience (audio and video might sound worse) + "RemoteAccess" # Routing and Remote Access + "RemoteRegistry" # Remote Registry + "RetailDemo" # Demo Mode for Store Display + "RtkBtManServ" # Realtek Bluetooth Device Manager Service + "SCardSvr" # Windows Smart Card Service + "seclogon" # Secondary Logon (Disables other credentials only password will work) + "SEMgrSvc" # Payments and NFC/SE Manager (Manages payments and Near Field Communication (NFC) based secure elements) + "SharedAccess" # Internet Connection Sharing (ICS) + #"Spooler" # Printing + "stisvc" # Windows Image Acquisition (WIA) + #"StorSvc" # StorSvc (usb external hard drive will not be reconized by windows) + "SysMain" # Analyses System Usage and Improves Performance + "TrkWks" # Distributed Link Tracking Client + #"WbioSrvc" # Windows Biometric Service (required for Fingerprint reader / facial detection) + "WerSvc" # Windows error reporting + "wisvc" # Windows Insider program(Windows Insider will not work if Disabled) + #"WlanSvc" # WLAN AutoConfig + "WMPNetworkSvc" # Windows Media Player Network Sharing Service + "WpcMonSvc" # Parental Controls + "WPDBusEnum" # Portable Device Enumerator Service + "WpnService" # WpnService (Push Notifications may not work) + #"wscsvc" # Windows Security Center Service + "WSearch" # Windows Search + "XblAuthManager" # Xbox Live Auth Manager + "XblGameSave" # Xbox Live Game Save Service + "XboxNetApiSvc" # Xbox Live Networking Service + "XboxGipSvc" # Xbox Accessory Management Service + #Hp services + "HPAppHelperCap" + "HPDiagsCap" + "HPNetworkCap" + "HPSysInfoCap" + "HpTouchpointAnalyticsService" + #hyper-v services + "HvHost" + "vmicguestinterface" + "vmicheartbeat" + "vmickvpexchange" + "vmicrdv" + "vmicshutdown" + "vmictimesync" + "vmicvmsession" + #Services that cannot be disabled + #"WdNisSvc" ) foreach ($service in $services) { @@ -1455,9 +1454,8 @@ $cortana.Add_Click({ }) $Bloatware = @( - #Unnecessary Windows 10 AppX Apps + #Unnecessary Windows 10/11 AppX Apps "Microsoft.3DBuilder" - "Microsoft.Microsoft3DViewer" "Microsoft.AppConnector" "Microsoft.BingFinance" "Microsoft.BingNews" @@ -1467,22 +1465,26 @@ $Bloatware = @( "Microsoft.BingFoodAndDrink" "Microsoft.BingHealthAndFitness" "Microsoft.BingTravel" - "Microsoft.MinecraftUWP" + "Microsoft.ConnectivityStore" + "Microsoft.CommsPhone" "Microsoft.GamingServices" - # "Microsoft.WindowsReadingList" "Microsoft.GetHelp" "Microsoft.Getstarted" "Microsoft.Messaging" "Microsoft.Microsoft3DViewer" "Microsoft.MicrosoftSolitaireCollection" + "Microsoft.MicrosoftOfficeHub" + #"Microsoft.MinecraftUWP" + "Microsoft.MixedReality.Portal" "Microsoft.NetworkSpeedTest" "Microsoft.News" "Microsoft.Office.Lens" - "Microsoft.Office.Sway" "Microsoft.Office.OneNote" + "Microsoft.Office.Sway" "Microsoft.OneConnect" "Microsoft.People" "Microsoft.Print3D" + "Microsoft.ScreenSketch" "Microsoft.SkypeApp" "Microsoft.Wallet" "Microsoft.Whiteboard" @@ -1491,55 +1493,50 @@ $Bloatware = @( "Microsoft.WindowsFeedbackHub" "Microsoft.WindowsMaps" "Microsoft.WindowsPhone" + #"Microsoft.WindowsReadingList" "Microsoft.WindowsSoundRecorder" "Microsoft.XboxApp" - "Microsoft.ConnectivityStore" - "Microsoft.CommsPhone" - "Microsoft.ScreenSketch" "Microsoft.Xbox.TCUI" "Microsoft.XboxGameOverlay" "Microsoft.XboxGameCallableUI" - "Microsoft.XboxSpeechToTextOverlay" - "Microsoft.MixedReality.Portal" "Microsoft.XboxIdentityProvider" + "Microsoft.XboxSpeechToTextOverlay" + "Microsoft.YourPhone" "Microsoft.ZuneMusic" "Microsoft.ZuneVideo" - "Microsoft.YourPhone" - "Microsoft.Getstarted" - "Microsoft.MicrosoftOfficeHub" - #Sponsored Windows 10 AppX Apps + #Sponsored Windows 10/11 AppX Apps #Add sponsored/featured apps to remove in the "*AppName*" format - "*EclipseManager*" "*ActiproSoftwareLLC*" + "*ACGMediaPlayer*" + "*AdobePhotoshopExpress*" "*AdobeSystemsIncorporated.AdobePhotoshopExpress*" - "*Duolingo-LearnLanguagesforFree*" - "*PandoraMediaInc*" - "*CandyCrush*" "*BubbleWitch3Saga*" - "*Wunderlist*" - "*Flipboard*" - "*Twitter*" - "*Facebook*" - "*Royal Revolt*" - "*Sway*" - "*Speed Test*" + "*CandyCrush*" "*Dolby*" - "*Viber*" - "*ACGMediaPlayer*" - "*Netflix*" - "*OneCalendar*" - "*LinkedInforWindows*" + "*Duolingo-LearnLanguagesforFree*" + "*EclipseManager*" + "*Facebook*" + "*Flipboard*" "*HiddenCityMysteryofShadows*" - "*Hulu*" "*HiddenCity*" - "*AdobePhotoshopExpress*" "*HotspotShieldFreeVPN*" + "*Hulu*" + "*LinkedInforWindows*" + "*Netflix*" + "*OneCalendar*" + "*PandoraMediaInc*" + "*Royal Revolt*" + "*Speed Test*" + "*Sway*" + "*Twitter*" + "*Viber*" + "*Wunderlist*" #Optional: Typically not removed but you can if you need to for some reason "*Microsoft.Advertising.Xaml*" - #"*Microsoft.MSPaint*" #"*Microsoft.MicrosoftStickyNotes*" + #"*Microsoft.MSPaint*" #"*Microsoft.Windows.Photos*" #"*Microsoft.WindowsCalculator*" #"*Microsoft.WindowsStore*" From 8a279ceca43392735b9be91e2ae2ba2602d81824 Mon Sep 17 00:00:00 2001 From: Carterpersall Date: Fri, 22 Apr 2022 23:09:02 -0500 Subject: [PATCH 04/12] Even more whitespace --- win10debloat.ps1 | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/win10debloat.ps1 b/win10debloat.ps1 index 89a17d5f..90d1abed 100644 --- a/win10debloat.ps1 +++ b/win10debloat.ps1 @@ -1175,13 +1175,13 @@ $essentialtweaks.Add_Click({ "XblGameSave" # Xbox Live Game Save Service "XboxNetApiSvc" # Xbox Live Networking Service "XboxGipSvc" # Xbox Accessory Management Service - #Hp services + # Hp services "HPAppHelperCap" "HPDiagsCap" "HPNetworkCap" "HPSysInfoCap" "HpTouchpointAnalyticsService" - #hyper-v services + # Hyper-V services "HvHost" "vmicguestinterface" "vmicheartbeat" @@ -1190,13 +1190,12 @@ $essentialtweaks.Add_Click({ "vmicshutdown" "vmictimesync" "vmicvmsession" - #Services that cannot be disabled + # Services that cannot be disabled #"WdNisSvc" ) 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 Manual" Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Manual } @@ -1229,9 +1228,11 @@ $essentialundo.Add_Click({ Write-Host "Enabling Telemetry..." Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 1 Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 1 + Write-Host "Enabling Wi-Fi Sense" Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 1 Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 1 + Write-Host "Enabling Application suggestions..." Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "ContentDeliveryAllowed" -Type DWord -Value 1 Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "OemPreInstalledAppsEnabled" -Type DWord -Value 1 @@ -1247,10 +1248,12 @@ $essentialundo.Add_Click({ Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Recurse -ErrorAction SilentlyContinue } Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 0 + Write-Host "Enabling Activity History..." Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableActivityFeed" -Type DWord -Value 1 Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "PublishUserActivities" -Type DWord -Value 1 Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "UploadUserActivities" -Type DWord -Value 1 + Write-Host "Enable Location Tracking..." If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location")) { Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Recurse -ErrorAction SilentlyContinue @@ -1258,44 +1261,56 @@ $essentialundo.Add_Click({ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Type String -Value "Allow" Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 1 Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 1 + Write-Host "Enabling automatic Maps updates..." Set-ItemProperty -Path "HKLM:\SYSTEM\Maps" -Name "AutoUpdateEnabled" -Type DWord -Value 1 + Write-Host "Enabling Feedback..." If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) { Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Recurse -ErrorAction SilentlyContinue } Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0 Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "DoNotShowFeedbackNotifications" -Type DWord -Value 0 + Write-Host "Enabling Tailored Experiences..." If (!(Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) { Remove-Item -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Recurse -ErrorAction SilentlyContinue } Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableTailoredExperiencesWithDiagnosticData" -Type DWord -Value 0 + Write-Host "Disabling Advertising ID..." If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo")) { Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Recurse -ErrorAction SilentlyContinue } Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Name "DisabledByGroupPolicy" -Type DWord -Value 0 + Write-Host "Allow Error reporting..." Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name "Disabled" -Type DWord -Value 0 + Write-Host "Allowing Diagnostics Tracking Service..." Stop-Service "DiagTrack" -WarningAction SilentlyContinue Set-Service "DiagTrack" -StartupType Manual + Write-Host "Allowing WAP Push Service..." Stop-Service "dmwappushservice" -WarningAction SilentlyContinue Set-Service "dmwappushservice" -StartupType Manual + Write-Host "Allowing Home Groups services..." Stop-Service "HomeGroupListener" -WarningAction SilentlyContinue Set-Service "HomeGroupListener" -StartupType Manual Stop-Service "HomeGroupProvider" -WarningAction SilentlyContinue Set-Service "HomeGroupProvider" -StartupType Manual + Write-Host "Enabling Storage Sense..." New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy" | Out-Null + Write-Host "Allowing Superfetch service..." Stop-Service "SysMain" -WarningAction SilentlyContinue Set-Service "SysMain" -StartupType Manual + Write-Host "Setting BIOS time to Local Time instead of UTC..." Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" -Name "RealTimeIsUniversal" -Type DWord -Value 0 + Write-Host "Enabling Hibernation..." Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Session Manager\Power" -Name "HibernteEnabled" -Type Dword -Value 1 Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings" -Name "ShowHibernateOption" -Type Dword -Value 1 @@ -1339,6 +1354,7 @@ $windowssearch.Add_Click({ Write-Host "Disabling Bing Search in Start Menu..." $ResultText.text = "`r`n" +"`r`n" + "Disabling Search, Cortana, Start menu search... Please Wait" Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value 0 + <# Write-Host "Disabling Cortana" Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "CortanaConsent" -Type DWord -Value 0 @@ -1346,11 +1362,11 @@ $windowssearch.Add_Click({ New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force | Out-Null } #> + Write-Host "Hiding Search Box / Button..." Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -Type DWord -Value 0 Write-Host "Removing Start Menu Tiles" - Set-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -Value '' Add-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -value ' ' Add-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -value ' ' @@ -1381,18 +1397,18 @@ $windowssearch.Add_Click({ $layoutFile="C:\Windows\StartMenuLayout.xml" - #Delete layout file if it already exists + # Delete layout file if it already exists If(Test-Path $layoutFile) { Remove-Item $layoutFile } - #Creates the blank layout file + # Creates the blank layout file $START_MENU_LAYOUT | Out-File $layoutFile -Encoding ASCII $regAliases = @("HKLM", "HKCU") - #Assign the start layout and force it to apply with "LockedStartLayout" at both the machine and user level + # Assign the start layout and force it to apply with "LockedStartLayout" at both the machine and user level foreach ($regAlias in $regAliases){ $basePath = $regAlias + ":\SOFTWARE\Policies\Microsoft\Windows" $keyPath = $basePath + "\Explorer" @@ -1403,7 +1419,7 @@ $windowssearch.Add_Click({ Set-ItemProperty -Path $keyPath -Name "StartLayoutFile" -Value $layoutFile } - #Restart Explorer, open the start menu (necessary to load the new layout), and give it a few seconds to process + # Restart Explorer, open the start menu (necessary to load the new layout), and give it a few seconds to process Stop-Process -name explorer Start-Sleep -s 5 $wshell = New-Object -ComObject wscript.shell; $wshell.SendKeys('^{ESCAPE}') From 5dcc20bcc1b0449a68003212a928678e3a33ec8e Mon Sep 17 00:00:00 2001 From: Carterpersall Date: Sat, 23 Apr 2022 10:56:50 -0500 Subject: [PATCH 05/12] More whitespace, write-host additions/modifications --- win10debloat.ps1 | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/win10debloat.ps1 b/win10debloat.ps1 index 90d1abed..ab4c1e5c 100644 --- a/win10debloat.ps1 +++ b/win10debloat.ps1 @@ -1592,9 +1592,11 @@ $defaultwindowsupdate.Add_Click({ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontSearchWindowsUpdate" -ErrorAction SilentlyContinue Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DriverUpdateWizardWuSearchEnabled" -ErrorAction SilentlyContinue Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ExcludeWUDriversInQualityUpdate" -ErrorAction SilentlyContinue + Write-Host "Enabling Windows Update automatic restart..." Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -ErrorAction SilentlyContinue Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -ErrorAction SilentlyContinue + Write-Host "Enabled driver offering through Windows Update" $ResultText.text = "`r`n" +"`r`n" + "Set Windows Updates to Stock Settings" }) @@ -1615,12 +1617,14 @@ $securitywindowsupdate.Add_Click({ New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" | Out-Null } Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ExcludeWUDriversInQualityUpdate" -Type DWord -Value 1 + Write-Host "Disabling Windows Update automatic restart..." 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 "NoAutoRebootWithLoggedOnUsers" -Type DWord -Value 1 Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -Type DWord -Value 0 + Write-Host "Disabled driver offering through Windows Update" $ResultText.text = "`r`n" +"`r`n" + "Set Windows Update to Sane Settings" }) @@ -1664,6 +1668,7 @@ $appearancefx.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 + Write-Host "Adjusted visual effects for appearance (Defaults)" $ResultText.text = "`r`n" +"`r`n" + "Visual effects are set for appearance (Defaults)" }) @@ -1673,6 +1678,7 @@ $onedrive.Add_Click({ New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" | Out-Null } Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" -Type DWord -Value 1 + Write-Host "Uninstalling OneDrive..." Stop-Process -Name "OneDrive" -ErrorAction SilentlyContinue Start-Sleep -s 2 @@ -1693,8 +1699,9 @@ $onedrive.Add_Click({ } Remove-Item -Path "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue Remove-Item -Path "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue - Write-Host "Disabled OneDrive" - $ResultText.text = "`r`n" +"`r`n" + "Deleted and Disabled OneDrive" + + Write-Host "Disabled and Uninstalled OneDrive" + $ResultText.text = "`r`n" +"`r`n" + "Disabled and Uninstalled OneDrive" }) $darkmode.Add_Click({ @@ -1705,9 +1712,9 @@ $darkmode.Add_Click({ }) $lightmode.Add_Click({ - Write-Host "Switching Back to Light Mode" + Write-Host "Enabled Light Mode" Remove-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme - Write-Host "Switched Back to Light Mode" + Write-Host "Enabled Light Mode" $ResultText.text = "`r`n" +"`r`n" + "Enabled Light Mode" }) @@ -1715,7 +1722,7 @@ $EActionCenter.Add_Click({ Write-Host "Enabling Action Center..." Remove-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer" -Name "DisableNotificationCenter" -ErrorAction SilentlyContinue Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled" -ErrorAction SilentlyContinue - Write-Host "Done - Reverted to Stock Settings" + Write-Host "Enabled Action Center" $ResultText.text = "`r`n" +"`r`n" + "Enabled Action Center" }) @@ -1729,16 +1736,20 @@ $ECortana.Add_Click({ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 0 Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -ErrorAction SilentlyContinue Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -ErrorAction SilentlyContinue + Write-Host "Restoring Windows Search..." Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value "1" Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "CortanaConsent" -ErrorAction SilentlyContinue Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "DisableWebSearch" -ErrorAction SilentlyContinue + Write-Host "Restore and Starting Windows Search Service..." Set-Service "WSearch" -StartupType Automatic Start-Service "WSearch" -WarningAction SilentlyContinue + Write-Host "Restore Windows Search Icon..." Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -Type DWord -Value 1 - Write-Host "Done - Reverted to Stock Settings" + + Write-Host "Enabled Cortana and Restored Search" $ResultText.text = "`r`n" +"`r`n" + "Enabled Cortana and Restored Search" }) @@ -1746,7 +1757,7 @@ $HTrayIcons.Add_Click({ Write-Host "Hiding tray icons..." Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -Type DWord -Value 1 - Write-Host "Done - Hid Tray Icons" + Write-Host "Hid Tray Icons" $ResultText.text = "`r`n" +"`r`n" + "Tray icons are now factory defaults" }) From 259576d729aa42b9b39a8d8739d187668453e994 Mon Sep 17 00:00:00 2001 From: Carterpersall Date: Sat, 23 Apr 2022 17:06:19 -0500 Subject: [PATCH 06/12] Lots more Improvements - Minor wording, capitalization, and whitespace changes throughout the script. - Changed the error action in $disableupdates and $enableupdates to pause instead of sleep to let the user choose when to close instead of waiting --- win10debloat.ps1 | 355 ++++++++++++++++++++++++----------------------- 1 file changed, 183 insertions(+), 172 deletions(-) diff --git a/win10debloat.ps1 b/win10debloat.ps1 index ab4c1e5c..9f638cad 100644 --- a/win10debloat.ps1 +++ b/win10debloat.ps1 @@ -1,7 +1,7 @@ Add-Type -AssemblyName System.Windows.Forms [System.Windows.Forms.Application]::EnableVisualStyles() -$ErrorActionPreference = 'SilentlyContinue' +$ErrorActionPreference = 'SilentlyContinue' # So commands don't throw an error to console $wshell = New-Object -ComObject Wscript.Shell $Button = [System.Windows.MessageBoxButton]::YesNoCancel $ErrorIco = [System.Windows.MessageBoxImage]::Error @@ -988,7 +988,7 @@ $essentialtweaks.Add_Click({ Write-Host "Disabling Storage Sense..." Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy" -Recurse -ErrorAction SilentlyContinue - Write-Host "Stopping and disabling Superfetch service..." + Write-Host "Stopping and Disabling Superfetch service..." Stop-Service "SysMain" -WarningAction SilentlyContinue Set-Service "SysMain" -StartupType Disabled @@ -1076,7 +1076,7 @@ $essentialtweaks.Add_Click({ $ram = (Get-CimInstance -ClassName Win32_PhysicalMemory | Measure-Object -Property Capacity -Sum).Sum / 1kb Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control" -Name "SvcHostSplitThresholdInKB" -Type DWord -Value $ram -Force - #Write-Host "Installing Windows Media Player..." + # Write-Host "Installing Windows Media Player..." #Enable-WindowsOptionalFeature -Online -FeatureName "WindowsMediaPlayer" -NoRestart -WarningAction SilentlyContinue | Out-Null Write-Host "Disable News and Interests" @@ -1192,13 +1192,12 @@ $essentialtweaks.Add_Click({ "vmicvmsession" # Services that cannot be disabled #"WdNisSvc" -) + ) -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 Manual" - Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Manual -} + foreach ($service in $services) { + Write-Host "Setting $service StartupType to Manual" + Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Manual + } Write-Host "Essential Tweaks Completed - Please Reboot" $ResultText.text = "`r`n" + "Essential Tweaks Done" + "`r`n" + "`r`n" + "Ready for Next Task" @@ -1211,12 +1210,15 @@ Write-Host "Setting BIOS time to UTC..." }) $laptopnumlock.Add_Click({ + Write-Host "Enabling Numlock at startup..." Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name "InitialKeyboardIndicators" -Type DWord -Value 0 Add-Type -AssemblyName System.Windows.Forms If (([System.Windows.Forms.Control]::IsKeyLocked('NumLock'))) { $wsh = New-Object -ComObject WScript.Shell $wsh.SendKeys('{NUMLOCK}') } + Write-Host "Numlock Enabled at Startup" + $ResultText.text = "`r`n" + "`r`n" +"Numlock Enabled at Startup" }) $essentialundo.Add_Click({ @@ -1321,6 +1323,7 @@ $essentialundo.Add_Click({ Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" -Recurse -ErrorAction SilentlyContinue } Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" -Name "EnthusiastMode" -Type DWord -Value 0 + Write-Host "Showing Task View button..." Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Type DWord -Value 1 Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" -Name "PeopleBand" -Type DWord -Value 1 @@ -1340,7 +1343,7 @@ $essentialundo.Add_Click({ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 1 Write-Host "Reset Local Group Policies to Stock Defaults" - # cmd /c secedit /configure /cfg %windir%\inf\defltbase.inf /db defltbase.sdb /verbose + #cmd /c secedit /configure /cfg %windir%\inf\defltbase.inf /db defltbase.sdb /verbose cmd /c RD /S /Q "%WinDir%\System32\GroupPolicyUsers" cmd /c RD /S /Q "%WinDir%\System32\GroupPolicy" cmd /c gpupdate /force @@ -1351,7 +1354,7 @@ $essentialundo.Add_Click({ }) $windowssearch.Add_Click({ - Write-Host "Disabling Bing Search in Start Menu..." + Write-Host "Disabling Search, Cortana, Start menu search..." $ResultText.text = "`r`n" +"`r`n" + "Disabling Search, Cortana, Start menu search... Please Wait" Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value 0 @@ -1412,7 +1415,7 @@ $windowssearch.Add_Click({ foreach ($regAlias in $regAliases){ $basePath = $regAlias + ":\SOFTWARE\Policies\Microsoft\Windows" $keyPath = $basePath + "\Explorer" - IF(!(Test-Path -Path $keyPath)) { + If(!(Test-Path -Path $keyPath)) { New-Item -Path $basePath -Name "Explorer" } Set-ItemProperty -Path $keyPath -Name "LockedStartLayout" -Value 1 @@ -1425,7 +1428,7 @@ $windowssearch.Add_Click({ $wshell = New-Object -ComObject wscript.shell; $wshell.SendKeys('^{ESCAPE}') Start-Sleep -s 5 - #Enable the ability to pin items again by disabling "LockedStartLayout" + # Enable the ability to pin items again by disabling "LockedStartLayout" foreach ($regAlias in $regAliases){ $basePath = $regAlias + ":\SOFTWARE\Policies\Microsoft\Windows" $keyPath = $basePath + "\Explorer" @@ -1437,13 +1440,13 @@ $windowssearch.Add_Click({ }) $backgroundapps.Add_Click({ - Write-Host "Disabling Background application access..." + Write-Host "Disabling Background applications..." Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Exclude "Microsoft.Windows.Cortana*" | ForEach { Set-ItemProperty -Path $_.PsPath -Name "Disabled" -Type DWord -Value 1 Set-ItemProperty -Path $_.PsPath -Name "DisabledByUser" -Type DWord -Value 1 } - Write-Host "Disabled Background application access" - $ResultText.text = "`r`n" +"`r`n" + "Disabled Background application access" + Write-Host "Disabled Background applications" + $ResultText.text = "`r`n" +"`r`n" + "Disabled Background applications" }) $cortana.Add_Click({ @@ -1470,7 +1473,7 @@ $cortana.Add_Click({ }) $Bloatware = @( - #Unnecessary Windows 10/11 AppX Apps + # Unnecessary Windows 10/11 AppX Apps "Microsoft.3DBuilder" "Microsoft.AppConnector" "Microsoft.BingFinance" @@ -1521,8 +1524,8 @@ $Bloatware = @( "Microsoft.ZuneMusic" "Microsoft.ZuneVideo" - #Sponsored Windows 10/11 AppX Apps - #Add sponsored/featured apps to remove in the "*AppName*" format + # Sponsored Windows 10/11 AppX Apps + # Add sponsored/featured apps to remove in the "*AppName*" format "*ActiproSoftwareLLC*" "*ACGMediaPlayer*" "*AdobePhotoshopExpress*" @@ -1549,7 +1552,7 @@ $Bloatware = @( "*Viber*" "*Wunderlist*" - #Optional: Typically not removed but you can if you need to for some reason + # Optional: Typically not removed but you can if you need to for some reason "*Microsoft.Advertising.Xaml*" #"*Microsoft.MicrosoftStickyNotes*" #"*Microsoft.MSPaint*" @@ -1581,8 +1584,8 @@ $reinstallbloat.Add_Click({ Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppxPackage -AllUsers $app).InstallLocation)\AppXManifest.xml" } - Write-Host "Finished Reinstalling Bloatware Apps" - $ResultText.text = "`r`n" +"`r`n" + "Finished Reinstalling Bloatware Apps" + Write-Host "Finished Reinstalling Removed Bloatware Apps" + $ResultText.text = "`r`n" +"`r`n" + "Finished Reinstalling Removed Bloatware Apps" }) $defaultwindowsupdate.Add_Click({ @@ -1652,7 +1655,7 @@ $performancefx.Add_Click({ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarAnimations" -Type DWord -Value 0 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" + Write-Host "Adjusted Visual Effects for performance" $ResultText.text = "`r`n" +"`r`n" + "Adjusted VFX for performance" }) @@ -1754,7 +1757,6 @@ $ECortana.Add_Click({ }) $HTrayIcons.Add_Click({ - Write-Host "Hiding tray icons..." Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -Type DWord -Value 1 Write-Host "Hid Tray Icons" @@ -1763,10 +1765,9 @@ $HTrayIcons.Add_Click({ $STrayIcons.Add_Click({ - Write-Host "Showing tray icons..." Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -Type DWord -Value 0 - Write-Host "Done - Now showing all tray icons" + Write-Host "Now showing all tray icons" $ResultText.text = "`r`n" +"`r`n" + "Tray Icons now set to show all" }) @@ -1774,19 +1775,22 @@ $EClipboardHistory.Add_Click({ 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 - Write-Host "Done - Reverted to Stock Settings" + Write-Host "Enabled Clipboard History" $ResultText.text = "`r`n" +"`r`n" + "Enabled Clipboard History" }) $ELocation.Add_Click({ Write-Host "Enabling Location Provider..." Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" -Name "DisableWindowsLocationProvider" -ErrorAction SilentlyContinue + Write-Host "Enabling Location Scripting..." Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" -Name "DisableLocationScripting" -ErrorAction SilentlyContinue + Write-Host "Enabling Location..." Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" -Name "DisableLocation" -ErrorAction SilentlyContinue Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -ErrorAction SilentlyContinue Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "Value" -Type String -Value "Allow" + Write-Host "Allow access to Location..." Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Type String -Value "Allow" Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value "1" @@ -1794,7 +1798,8 @@ $ELocation.Add_Click({ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessLocation_UserInControlOfTheseApps" -ErrorAction SilentlyContinue Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessLocation_ForceAllowTheseApps" -ErrorAction SilentlyContinue Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessLocation_ForceDenyTheseApps" -ErrorAction SilentlyContinue - Write-Host "Done - Reverted to Stock Settings" + + Write-Host "Location Tracking Enabled" $ResultText.text = "`r`n" +"`r`n" + "Location Tracking now on... Reboot to check." }) @@ -1804,7 +1809,7 @@ $RBackgroundApps.Add_Click({ Remove-ItemProperty -Path $_.PsPath -Name "Disabled" -ErrorAction SilentlyContinue Remove-ItemProperty -Path $_.PsPath -Name "DisabledByUser" -ErrorAction SilentlyContinue } - Write-Host "Done - Reverted to Stock Settings" + Write-Host "Background Apps Enabled" $ResultText.text = "`r`n" +"`r`n" + "Enabled Background Apps" }) @@ -1812,7 +1817,7 @@ $EHibernation.Add_Click({ Write-Host "Enabling Hibernation" Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Session Manager\Power" -Name "HibernteEnabled" -Type Dword -Value 1 Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings" -Name "ShowHibernateOption" -Type Dword -Value 1 - Write-Host "Done - Reverted to Stock Settings" + Write-Host "Hibernation Enabled" $ResultText.text = "`r`n" +"`r`n" + "Enabled Hibernation" }) @@ -1831,21 +1836,25 @@ $DisableNumLock.Add_Click({ $wsh = New-Object -ComObject WScript.Shell $wsh.SendKeys('{NUMLOCK}') } - $ResultText.text = "`r`n" +"`r`n" + "NUMLOCK Disabled" + Write-Host "NumLock Disabled at startup" + $ResultText.text = "`r`n" +"`r`n" + "NUMLOCK Disabled at startup" }) $yourphonefix.Add_Click({ Write-Host "Reinstalling Your Phone App" Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.YourPhone").InstallLocation)\AppXManifest.xml" + Write-Host "Enable needed data collection for Your Phone..." Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableMmx" -Type DWord -Value 1 Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableCdp" -Type DWord -Value 1 Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Messaging" -Name "AllowMessageSync" -Type DWord -Value 1 + Write-Host "Allowing Background Apps..." Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Exclude "Microsoft.Windows.Cortana*" | ForEach { Remove-ItemProperty -Path $_.PsPath -Name "Disabled" -ErrorAction SilentlyContinue Remove-ItemProperty -Path $_.PsPath -Name "DisabledByUser" -ErrorAction SilentlyContinue } + Write-Host "You may need to Reboot and right-click Your Phone app and select repair" $ResultText.text = "`r`n" +"`r`n" + "You may need to Reboot and right-click Your Phone app and select repair" }) @@ -1853,18 +1862,23 @@ $yourphonefix.Add_Click({ $ncpa.Add_Click({ cmd /c ncpa.cpl }) + $oldsoundpanel.Add_Click({ cmd /c mmsys.cpl }) + $oldcontrolpanel.Add_Click({ cmd /c control }) + $oldsystempanel.Add_Click({ cmd /c sysdm.cpl }) + $oldpower.Add_Click({ cmd /c powercfg.cpl }) + $restorepower.Add_Click({ powercfg -duplicatescheme a1841308-3541-4fab-bc81-f71556f20b4a powercfg -duplicatescheme 381b4222-f694-41f0-9685-ff5bb260df2e @@ -1872,7 +1886,10 @@ $restorepower.Add_Click({ Write-Host "Restored all power plans: Balanced, High Performance, and Power Saver" $ResultText.text = "`r`n" +"`r`n" + "Restored all power plans: Balanced, High Performance, and Power Saver" }) + $NFS.Add_Click({ + Write-Host "Enabling NFS..." + $ResultText.text = "`r`n" +"`r`n" + "Enabling NFS..." Enable-WindowsOptionalFeature -Online -FeatureName "ServicesForNFS-ClientOnly" -All Enable-WindowsOptionalFeature -Online -FeatureName "ClientForNFS-Infrastructure" -All Enable-WindowsOptionalFeature -Online -FeatureName "NFS-Administration" -All @@ -1886,6 +1903,8 @@ $NFS.Add_Click({ }) $Virtualization.Add_Click({ + Write-Host "Installing Hyper-V" + $ResultText.text = "`r`n" +"`r`n" + "Installing Hyper-V" Enable-WindowsOptionalFeature -Online -FeatureName "HypervisorPlatform" -All Enable-WindowsOptionalFeature -Online -FeatureName "VirtualMachinePlatform" -All Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Windows-Subsystem-Linux" -All @@ -1997,175 +2016,167 @@ $windowsupdatefix.Add_Click({ }) $disableupdates.Add_Click({ - # Source: https://github.com/rgl/windows-vagrant/blob/master/disable-windows-updates.ps1 Set-StrictMode -Version Latest -$ProgressPreference = 'SilentlyContinue' -$ErrorActionPreference = 'Stop' -trap { - Write-Host - Write-Host "ERROR: $_" - Write-Host (($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1') - Write-Host (($_.Exception.ToString() -split '\r?\n') -replace '^(.*)$','ERROR EXCEPTION: $1') - Write-Host - Write-Host 'Sleeping for 60m to give you time to look around the virtual machine before self-destruction...' - Start-Sleep -Seconds (60*60) - Exit 1 -} + $ProgressPreference = 'SilentlyContinue' + $ErrorActionPreference = 'Stop' + trap { + Write-Host + Write-Host "ERROR: $_" + Write-Host (($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1') + Write-Host (($_.Exception.ToString() -split '\r?\n') -replace '^(.*)$','ERROR EXCEPTION: $1') + Write-Host + Write-Host 'Press any key to exit...' + pause + Exit 1 + } -# 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 + # Disable automatic updates. + # 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 } - $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) { + $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 $deliveryOptimizationPath ` - -Name DODownloadMode ` - -Value 0 ` + -Path $auPath ` + -Name NoAutoUpdate ` + -Value 1 ` -PropertyType DWORD ` -Force ` | Out-Null -} -# Service tweaks for Windows Update -$services = @( - "BITS" - "wuauserv" -) + # 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 -foreach ($service in $services) { - # -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist + # Disable Windows Update Delivery Optimization. + # 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 + } - Write-Host "Setting $service StartupType to Disabled" - Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Disabled -} + # Service tweaks for Windows Update + $services = @( + "BITS" + "wuauserv" + ) + + foreach ($service in $services) { + Write-Host "Setting $service StartupType to Disabled" + Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Disabled + } }) $enableupdates.Add_Click({ - # Source: https://github.com/rgl/windows-vagrant/blob/master/disable-windows-updates.ps1 Set-StrictMode -Version Latest -$ProgressPreference = 'SilentlyContinue' -$ErrorActionPreference = 'Stop' -trap { - Write-Host - Write-Host "ERROR: $_" - Write-Host (($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1') - Write-Host (($_.Exception.ToString() -split '\r?\n') -replace '^(.*)$','ERROR EXCEPTION: $1') - Write-Host - Write-Host 'Sleeping for 60m to give you time to look around the virtual machine before self-destruction...' - Start-Sleep -Seconds (60*60) - Exit 1 -} + $ProgressPreference = 'SilentlyContinue' + $ErrorActionPreference = 'Stop' + trap { + Write-Host + Write-Host "ERROR: $_" + Write-Host (($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1') + Write-Host (($_.Exception.ToString() -split '\r?\n') -replace '^(.*)$','ERROR EXCEPTION: $1') + Write-Host + Write-Host 'Press any key to exit...' + pause + Exit 1 + } -# 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 + # Disable automatic updates. + # 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 } - $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) { + $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 $deliveryOptimizationPath ` - -Name DODownloadMode ` + -Path $auPath ` + -Name NoAutoUpdate ` -Value 0 ` -PropertyType DWORD ` -Force ` | Out-Null -} -# Service tweaks for Windows Update + # 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 -$services = @( - "BITS" - "wuauserv" -) + # Disable Windows Update Delivery Optimization. + # 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 + } -foreach ($service in $services) { - # -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist + # Service tweaks for Windows Update + $services = @( + "BITS" + "wuauserv" + ) - Write-Host "Setting $service StartupType to Automatic" - Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Automatic -} + foreach ($service in $services) { + Write-Host "Setting $service StartupType to Automatic" + Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Automatic + } }) [void]$Form.ShowDialog() From 62ff6713ab940815697f51b9f031ee8da8939a00 Mon Sep 17 00:00:00 2001 From: Carterpersall Date: Sun, 24 Apr 2022 07:12:16 -0500 Subject: [PATCH 07/12] Make if-statement formatting consistant - Made if-statement formatting more consistant --- win10debloat.ps1 | 80 ++++++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/win10debloat.ps1 b/win10debloat.ps1 index 9f638cad..8d6dbfb6 100644 --- a/win10debloat.ps1 +++ b/win10debloat.ps1 @@ -5,7 +5,7 @@ $ErrorActionPreference = 'SilentlyContinue' # So commands don't throw an error t $wshell = New-Object -ComObject Wscript.Shell $Button = [System.Windows.MessageBoxButton]::YesNoCancel $ErrorIco = [System.Windows.MessageBoxImage]::Error -If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]'Administrator')) { +if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]'Administrator')) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs Exit } @@ -895,7 +895,7 @@ $essentialtweaks.Add_Click({ Disable-ScheduledTask -TaskName "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" | Out-Null Write-Host "Disabling Wi-Fi Sense..." - If (!(Test-Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) { + if (!(Test-Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) { New-Item -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Force | Out-Null } Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 0 @@ -912,7 +912,7 @@ $essentialtweaks.Add_Click({ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338389Enabled" -Type DWord -Value 0 Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-353698Enabled" -Type DWord -Value 0 Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 0 - If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) { + if (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) { New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Force | Out-Null } Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 1 @@ -924,7 +924,7 @@ $essentialtweaks.Add_Click({ # Keep Location Tracking commented out if you want the ability to locate your device Write-Host "Disabling Location Tracking..." - If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location")) { + if (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location")) { New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Force | Out-Null } Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Type String -Value "Deny" @@ -935,7 +935,7 @@ $essentialtweaks.Add_Click({ Set-ItemProperty -Path "HKLM:\SYSTEM\Maps" -Name "AutoUpdateEnabled" -Type DWord -Value 0 Write-Host "Disabling Feedback..." - If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) { + if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) { New-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Force | Out-Null } Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0 @@ -944,13 +944,13 @@ $essentialtweaks.Add_Click({ Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload" -ErrorAction SilentlyContinue | Out-Null Write-Host "Disabling Tailored Experiences..." - If (!(Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) { + if (!(Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) { New-Item -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Force | Out-Null } Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableTailoredExperiencesWithDiagnosticData" -Type DWord -Value 1 Write-Host "Disabling Advertising ID..." - If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo")) { + if (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo")) { New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" | Out-Null } Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Name "DisabledByGroupPolicy" -Type DWord -Value 1 @@ -960,7 +960,7 @@ $essentialtweaks.Add_Click({ Disable-ScheduledTask -TaskName "Microsoft\Windows\Windows Error Reporting\QueueReporting" | Out-Null Write-Host "Restricting Windows Update P2P only to local network..." - If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) { + if (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) { New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" | Out-Null } Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1 @@ -994,11 +994,11 @@ $essentialtweaks.Add_Click({ Write-Host "Disabling Hibernation..." Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Session Manager\Power" -Name "HibernteEnabled" -Type Dword -Value 0 - If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings")) { + if (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings")) { New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings" | Out-Null } Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings" -Name "ShowHibernateOption" -Type Dword -Value 0 - If ((get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name CurrentBuild).CurrentBuild -lt 22557) { + if ((get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name CurrentBuild).CurrentBuild -lt 22557) { Write-Host "Showing task manager details..." $taskmgr = Start-Process -WindowStyle Hidden -FilePath taskmgr.exe -PassThru Do { @@ -1011,7 +1011,7 @@ $essentialtweaks.Add_Click({ } else {Write-Host "Task Manager patch not run in builds 22557+ due to bug"} Write-Host "Showing file operations details..." - If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager")) { + if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager")) { New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" | Out-Null } Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" -Name "EnthusiastMode" -Type DWord -Value 1 @@ -1020,7 +1020,7 @@ $essentialtweaks.Add_Click({ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Type DWord -Value 0 Write-Host "Hiding People icon..." - If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People")) { + if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People")) { New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" | Out-Null } Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" -Name "PeopleBand" -Type DWord -Value 0 @@ -1029,12 +1029,12 @@ $essentialtweaks.Add_Click({ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -Type DWord -Value 1 Write-Host "Enabling NumLock after startup..." - If (!(Test-Path "HKU:")) { + if (!(Test-Path "HKU:")) { New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null } Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name "InitialKeyboardIndicators" -Type DWord -Value 2147483650 Add-Type -AssemblyName System.Windows.Forms - If (!([System.Windows.Forms.Control]::IsKeyLocked('NumLock'))) { + if (!([System.Windows.Forms.Control]::IsKeyLocked('NumLock'))) { $wsh = New-Object -ComObject WScript.Shell $wsh.SendKeys('{NUMLOCK}') } @@ -1086,14 +1086,14 @@ $essentialtweaks.Add_Click({ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds" -Name "ShellFeedsTaskbarViewMode" -Type DWord -Value 2 # Remove "Meet Now" button from taskbar - If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer")) { + if (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer")) { New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Force | Out-Null } Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "HideSCAMeetNow" -Type DWord -Value 1 Write-Host "Removing AutoLogger file and restricting directory..." $autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger" - If (Test-Path "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl") { + if (Test-Path "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl") { Remove-Item "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl" } icacls $autoLoggerDir /deny SYSTEM:`(OI`)`(CI`)F | Out-Null @@ -1213,7 +1213,7 @@ $laptopnumlock.Add_Click({ Write-Host "Enabling Numlock at startup..." Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name "InitialKeyboardIndicators" -Type DWord -Value 0 Add-Type -AssemblyName System.Windows.Forms - If (([System.Windows.Forms.Control]::IsKeyLocked('NumLock'))) { + if (([System.Windows.Forms.Control]::IsKeyLocked('NumLock'))) { $wsh = New-Object -ComObject WScript.Shell $wsh.SendKeys('{NUMLOCK}') } @@ -1246,7 +1246,7 @@ $essentialundo.Add_Click({ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338389Enabled" -Type DWord -Value 1 Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-353698Enabled" -Type DWord -Value 1 Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 1 - If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) { + if (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) { Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Recurse -ErrorAction SilentlyContinue } Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 0 @@ -1257,7 +1257,7 @@ $essentialundo.Add_Click({ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "UploadUserActivities" -Type DWord -Value 1 Write-Host "Enable Location Tracking..." - If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location")) { + if (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location")) { Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Recurse -ErrorAction SilentlyContinue } Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Type String -Value "Allow" @@ -1268,20 +1268,20 @@ $essentialundo.Add_Click({ Set-ItemProperty -Path "HKLM:\SYSTEM\Maps" -Name "AutoUpdateEnabled" -Type DWord -Value 1 Write-Host "Enabling Feedback..." - If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) { + if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) { Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Recurse -ErrorAction SilentlyContinue } Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0 Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "DoNotShowFeedbackNotifications" -Type DWord -Value 0 Write-Host "Enabling Tailored Experiences..." - If (!(Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) { + if (!(Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) { Remove-Item -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Recurse -ErrorAction SilentlyContinue } Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableTailoredExperiencesWithDiagnosticData" -Type DWord -Value 0 Write-Host "Disabling Advertising ID..." - If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo")) { + if (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo")) { Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Recurse -ErrorAction SilentlyContinue } Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Name "DisabledByGroupPolicy" -Type DWord -Value 0 @@ -1319,7 +1319,7 @@ $essentialundo.Add_Click({ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen" -ErrorAction SilentlyContinue Write-Host "Hiding file operations details..." - If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager")) { + if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager")) { Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" -Recurse -ErrorAction SilentlyContinue } Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" -Name "EnthusiastMode" -Type DWord -Value 0 @@ -1361,7 +1361,7 @@ $windowssearch.Add_Click({ <# Write-Host "Disabling Cortana" Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "CortanaConsent" -Type DWord -Value 0 - If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) { + if (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) { New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force | Out-Null } #> @@ -1401,7 +1401,7 @@ $windowssearch.Add_Click({ $layoutFile="C:\Windows\StartMenuLayout.xml" # Delete layout file if it already exists - If(Test-Path $layoutFile) + if(Test-Path $layoutFile) { Remove-Item $layoutFile } @@ -1415,7 +1415,7 @@ $windowssearch.Add_Click({ foreach ($regAlias in $regAliases){ $basePath = $regAlias + ":\SOFTWARE\Policies\Microsoft\Windows" $keyPath = $basePath + "\Explorer" - If(!(Test-Path -Path $keyPath)) { + if(!(Test-Path -Path $keyPath)) { New-Item -Path $basePath -Name "Explorer" } Set-ItemProperty -Path $keyPath -Name "LockedStartLayout" -Value 1 @@ -1451,20 +1451,20 @@ $backgroundapps.Add_Click({ $cortana.Add_Click({ Write-Host "Disabling Cortana..." - If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings")) { + if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings")) { New-Item -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Force | Out-Null } Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value 0 - If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization")) { + if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization")) { New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Force | Out-Null } Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 1 Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 1 - If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) { + if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) { New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null } Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value 0 - If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) { + if (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) { New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force | Out-Null } Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -Type DWord -Value 0 @@ -1606,23 +1606,23 @@ $defaultwindowsupdate.Add_Click({ $securitywindowsupdate.Add_Click({ 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")) { New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Force | Out-Null } Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -Type DWord -Value 1 - If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching")) { + if (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching")) { New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Force | Out-Null } Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontPromptForWindowsUpdate" -Type DWord -Value 1 Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontSearchWindowsUpdate" -Type DWord -Value 1 Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DriverUpdateWizardWuSearchEnabled" -Type DWord -Value 0 - If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate")) { + if (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate")) { New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" | Out-Null } Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ExcludeWUDriversInQualityUpdate" -Type DWord -Value 1 Write-Host "Disabling Windows Update automatic restart..." - If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) { + 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 "NoAutoRebootWithLoggedOnUsers" -Type DWord -Value 1 @@ -1634,7 +1634,7 @@ $securitywindowsupdate.Add_Click({ $actioncenter.Add_Click({ Write-Host "Disabling Action Center..." - If (!(Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer")) { + if (!(Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer")) { New-Item -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer" | Out-Null } Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer" -Name "DisableNotificationCenter" -Type DWord -Value 1 @@ -1677,7 +1677,7 @@ $appearancefx.Add_Click({ $onedrive.Add_Click({ Write-Host "Disabling OneDrive..." - If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive")) { + if (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive")) { New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" | Out-Null } Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" -Type DWord -Value 1 @@ -1686,7 +1686,7 @@ $onedrive.Add_Click({ Stop-Process -Name "OneDrive" -ErrorAction SilentlyContinue Start-Sleep -s 2 $onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe" - If (!(Test-Path $onedrive)) { + if (!(Test-Path $onedrive)) { $onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe" } Start-Process $onedrive "/uninstall" -NoNewWindow -Wait @@ -1697,7 +1697,7 @@ $onedrive.Add_Click({ Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue Remove-Item -Path "$env:PROGRAMDATA\Microsoft OneDrive" -Force -Recurse -ErrorAction SilentlyContinue Remove-Item -Path "$env:SYSTEMDRIVE\OneDriveTemp" -Force -Recurse -ErrorAction SilentlyContinue - If (!(Test-Path "HKCR:")) { + if (!(Test-Path "HKCR:")) { New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null } Remove-Item -Path "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue @@ -1732,7 +1732,7 @@ $EActionCenter.Add_Click({ $ECortana.Add_Click({ Write-Host "Enabling Cortana..." Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -ErrorAction SilentlyContinue - If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) { + if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) { New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null } Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 0 @@ -1832,7 +1832,7 @@ $DisableNumLock.Add_Click({ Write-Host "Disable NumLock after startup..." Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name "InitialKeyboardIndicators" -Type DWord -Value 0 Add-Type -AssemblyName System.Windows.Forms - If (([System.Windows.Forms.Control]::IsKeyLocked('NumLock'))) { + if (([System.Windows.Forms.Control]::IsKeyLocked('NumLock'))) { $wsh = New-Object -ComObject WScript.Shell $wsh.SendKeys('{NUMLOCK}') } From f3cb067b4841a772a78bb26c1058a448fac2b9fe Mon Sep 17 00:00:00 2001 From: Carterpersall Date: Sun, 24 Apr 2022 07:40:17 -0500 Subject: [PATCH 08/12] More formatting/logging - Started adding $Resulttext.text logging whenever there is a Write-Host at the beginning of a task - More whitespace additions/reductions --- win10debloat.ps1 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/win10debloat.ps1 b/win10debloat.ps1 index 8d6dbfb6..f6575aa0 100644 --- a/win10debloat.ps1 +++ b/win10debloat.ps1 @@ -976,7 +976,7 @@ $essentialtweaks.Add_Click({ Write-Host "Enabling F8 boot menu options..." bcdedit /set `{current`} bootmenupolicy Legacy | Out-Null - Write-Host "Stopping and disabling Home Groups services..." + Write-Host "Stopping and disabling HomeGroup services..." Stop-Service "HomeGroupListener" -WarningAction SilentlyContinue Set-Service "HomeGroupListener" -StartupType Disabled Stop-Service "HomeGroupProvider" -WarningAction SilentlyContinue @@ -1563,6 +1563,7 @@ $Bloatware = @( $removebloat.Add_Click({ Write-Host "Removing Bloatware" + $ResultText.text = "`r`n" +"`r`n" + "Removing Bloatware" foreach ($Bloat in $Bloatware) { Get-AppxPackage -Name $Bloat| Remove-AppxPackage @@ -1577,6 +1578,7 @@ $removebloat.Add_Click({ $reinstallbloat.Add_Click({ Write-Host "Reinstalling Bloatware" + $ResultText.text = "`r`n" +"`r`n" + "Reinstalling Bloatware" foreach ($app in $Bloatware) { Write-Output "Trying to add $app" @@ -1677,6 +1679,9 @@ $appearancefx.Add_Click({ $onedrive.Add_Click({ Write-Host "Disabling OneDrive..." + $ResultText.text = "`r`n" +"`r`n" + "Disabling and Uninstalling OneDrive" + + # Disable OneDrive if (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive")) { New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" | Out-Null } @@ -1823,6 +1828,7 @@ $EHibernation.Add_Click({ $InstallOneDrive.Add_Click({ Write-Host "Installing Onedrive. Please Wait..." + $ResultText.text = "`r`n" +"`r`n" + "Installing Onedrive. Please Wait..." Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" -ErrorAction SilentlyContinue %systemroot%\SysWOW64\OneDriveSetup.exe $ResultText.text = "`r`n" +"`r`n" + "Finished Reinstalling OneDrive" @@ -1842,6 +1848,9 @@ $DisableNumLock.Add_Click({ $yourphonefix.Add_Click({ Write-Host "Reinstalling Your Phone App" + $ResultText.text = "`r`n" +"`r`n" + "Reinstalling Your Phone App" + + # Reinstalling Your Phone App Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.YourPhone").InstallLocation)\AppXManifest.xml" Write-Host "Enable needed data collection for Your Phone..." @@ -2012,7 +2021,6 @@ $windowsupdatefix.Add_Click({ Write-Host "Process complete. Please reboot your computer." $ResultText.text = "`r`n" +"`r`n" + "Process complete. Please reboot your computer." - }) $disableupdates.Add_Click({ From 9b60c653cf9ea225743597f03e88446fc63c58ff Mon Sep 17 00:00:00 2001 From: Carterpersall Date: Sun, 24 Apr 2022 08:13:54 -0500 Subject: [PATCH 09/12] More Logging - Finished adding Write-Host and $ResultText.text logging whenever a task isn't instand - Added Write-Host and $ResultText.text logging where it was missing --- win10debloat.ps1 | 77 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 53 insertions(+), 24 deletions(-) diff --git a/win10debloat.ps1 b/win10debloat.ps1 index f6575aa0..7353709b 100644 --- a/win10debloat.ps1 +++ b/win10debloat.ps1 @@ -1204,13 +1204,15 @@ $essentialtweaks.Add_Click({ }) $dualboottime.Add_Click({ -Write-Host "Setting BIOS time to UTC..." + Write-Host "Setting BIOS time to UTC..." Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" -Name "RealTimeIsUniversal" -Type DWord -Value 1 + Write-Host "Time set to UTC for consistent time in Dual Boot Systems" $ResultText.text = "`r`n" + "Time set to UTC for consistent time in Dual Boot Systems" + "`r`n" + "`r`n" + "Ready for Next Task" }) $laptopnumlock.Add_Click({ Write-Host "Enabling Numlock at startup..." + $ResultText.text = "`r`n" + "`r`n" + "Enabling Numlock at startup..." Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name "InitialKeyboardIndicators" -Type DWord -Value 0 Add-Type -AssemblyName System.Windows.Forms if (([System.Windows.Forms.Control]::IsKeyLocked('NumLock'))) { @@ -1231,7 +1233,7 @@ $essentialundo.Add_Click({ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 1 Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 1 - Write-Host "Enabling Wi-Fi Sense" + Write-Host "Enabling Wi-Fi Sense..." Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 1 Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 1 @@ -1331,18 +1333,18 @@ $essentialundo.Add_Click({ Write-Host "Changing default Explorer view to Quick Access..." Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Type DWord -Value 1 - Write-Host "Unrestricting AutoLogger directory" + Write-Host "Unrestricting AutoLogger directory..." $autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger" icacls $autoLoggerDir /grant:r SYSTEM:`(OI`)`(CI`)F | Out-Null - Write-Host "Enabling and starting Diagnostics Tracking Service" + Write-Host "Enabling and starting Diagnostics Tracking Service..." Set-Service "DiagTrack" -StartupType Automatic Start-Service "DiagTrack" - Write-Host "Hiding known file extensions" + Write-Host "Hiding known file extensions..." Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 1 - Write-Host "Reset Local Group Policies to Stock Defaults" + Write-Host "Resetting Local Group Policies to Stock Defaults..." #cmd /c secedit /configure /cfg %windir%\inf\defltbase.inf /db defltbase.sdb /verbose cmd /c RD /S /Q "%WinDir%\System32\GroupPolicyUsers" cmd /c RD /S /Q "%WinDir%\System32\GroupPolicy" @@ -1354,12 +1356,12 @@ $essentialundo.Add_Click({ }) $windowssearch.Add_Click({ - Write-Host "Disabling Search, Cortana, Start menu search..." - $ResultText.text = "`r`n" +"`r`n" + "Disabling Search, Cortana, Start menu search... Please Wait" + Write-Host "Disabling Search and Start menu search..." + $ResultText.text = "`r`n" +"`r`n" + "Disabling Search and Start menu search... Please Wait" Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value 0 <# - Write-Host "Disabling Cortana" + Write-Host "Disabling Cortana..." Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "CortanaConsent" -Type DWord -Value 0 if (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) { New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force | Out-Null @@ -1369,7 +1371,7 @@ $windowssearch.Add_Click({ Write-Host "Hiding Search Box / Button..." Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -Type DWord -Value 0 - Write-Host "Removing Start Menu Tiles" + Write-Host "Removing Start Menu Tiles..." Set-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -Value '' Add-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -value ' ' Add-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -value ' ' @@ -1433,14 +1435,14 @@ $windowssearch.Add_Click({ $basePath = $regAlias + ":\SOFTWARE\Policies\Microsoft\Windows" $keyPath = $basePath + "\Explorer" Set-ItemProperty -Path $keyPath -Name "LockedStartLayout" -Value 0 - + } Write-Host "Search and Start Menu Tweaks Complete" $ResultText.text = "`r`n" +"`r`n" + "Search and Start Menu Tweaks Complete" - } }) $backgroundapps.Add_Click({ Write-Host "Disabling Background applications..." + $ResultText.text = "`r`n" +"`r`n" + "Disabling Background applications..." Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Exclude "Microsoft.Windows.Cortana*" | ForEach { Set-ItemProperty -Path $_.PsPath -Name "Disabled" -Type DWord -Value 1 Set-ItemProperty -Path $_.PsPath -Name "DisabledByUser" -Type DWord -Value 1 @@ -1602,7 +1604,7 @@ $defaultwindowsupdate.Add_Click({ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -ErrorAction SilentlyContinue Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -ErrorAction SilentlyContinue - Write-Host "Enabled driver offering through Windows Update" + Write-Host "Set Windows Updates to Stock Settings" $ResultText.text = "`r`n" +"`r`n" + "Set Windows Updates to Stock Settings" }) @@ -1630,7 +1632,7 @@ $securitywindowsupdate.Add_Click({ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -Type DWord -Value 1 Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -Type DWord -Value 0 - Write-Host "Disabled driver offering through Windows Update" + Write-Host "Set Windows Update to Safe Settings" $ResultText.text = "`r`n" +"`r`n" + "Set Windows Update to Sane Settings" }) @@ -1678,10 +1680,9 @@ $appearancefx.Add_Click({ }) $onedrive.Add_Click({ - Write-Host "Disabling OneDrive..." $ResultText.text = "`r`n" +"`r`n" + "Disabling and Uninstalling OneDrive" - # Disable OneDrive + Write-Host "Disabling OneDrive..." if (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive")) { New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" | Out-Null } @@ -1735,6 +1736,8 @@ $EActionCenter.Add_Click({ }) $ECortana.Add_Click({ + $ResultText.text = "`r`n" +"`r`n" + "Enabling Cortana amd Restoring Search..." + Write-Host "Enabling Cortana..." Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -ErrorAction SilentlyContinue if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) { @@ -1764,8 +1767,8 @@ $ECortana.Add_Click({ $HTrayIcons.Add_Click({ Write-Host "Hiding tray icons..." Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -Type DWord -Value 1 - Write-Host "Hid Tray Icons" - $ResultText.text = "`r`n" +"`r`n" + "Tray icons are now factory defaults" + Write-Host "Tray Icons Hidden (Default)" + $ResultText.text = "`r`n" +"`r`n" + "Tray icons Hidden (Default)" }) @@ -1773,7 +1776,7 @@ $STrayIcons.Add_Click({ Write-Host "Showing tray icons..." Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -Type DWord -Value 0 Write-Host "Now showing all tray icons" - $ResultText.text = "`r`n" +"`r`n" + "Tray Icons now set to show all" + $ResultText.text = "`r`n" +"`r`n" + "Now showing all tray icons" }) $EClipboardHistory.Add_Click({ @@ -1827,15 +1830,16 @@ $EHibernation.Add_Click({ }) $InstallOneDrive.Add_Click({ - Write-Host "Installing Onedrive. Please Wait..." - $ResultText.text = "`r`n" +"`r`n" + "Installing Onedrive. Please Wait..." + Write-Host "Installing Onedrive, Please Wait..." + $ResultText.text = "`r`n" +"`r`n" + "Installing Onedrive, Please Wait..." Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" -ErrorAction SilentlyContinue %systemroot%\SysWOW64\OneDriveSetup.exe $ResultText.text = "`r`n" +"`r`n" + "Finished Reinstalling OneDrive" }) $DisableNumLock.Add_Click({ - Write-Host "Disable NumLock after startup..." + Write-Host "Disable NumLock at startup..." + $ResultText.text = "`r`n" +"`r`n" + "Disabling NumLock at startup..." Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name "InitialKeyboardIndicators" -Type DWord -Value 0 Add-Type -AssemblyName System.Windows.Forms if (([System.Windows.Forms.Control]::IsKeyLocked('NumLock'))) { @@ -1869,22 +1873,32 @@ $yourphonefix.Add_Click({ }) $ncpa.Add_Click({ + Write-Host "Opening Network Connections..." + $ResultText.text = "`r`n" +"`r`n" + "Opening Network Connections..." cmd /c ncpa.cpl }) $oldsoundpanel.Add_Click({ + Write-Host "Opening Old Sound Panel..." + $ResultText.text = "`r`n" +"`r`n" + "Opening Old Sound Panel..." cmd /c mmsys.cpl }) $oldcontrolpanel.Add_Click({ + Write-Host "Opening Old Control Panel..." + $ResultText.text = "`r`n" +"`r`n" + "Opening Old Control Panel..." cmd /c control }) $oldsystempanel.Add_Click({ + Write-Host "Opening Old System Panel..." + $ResultText.text = "`r`n" +"`r`n" + "Opening Old System Panel..." cmd /c sysdm.cpl }) $oldpower.Add_Click({ + Write-Host "Opening Old Power Options..." + $ResultText.text = "`r`n" +"`r`n" + "Opening Old Power Options..." cmd /c powercfg.cpl }) @@ -1912,8 +1926,8 @@ $NFS.Add_Click({ }) $Virtualization.Add_Click({ - Write-Host "Installing Hyper-V" - $ResultText.text = "`r`n" +"`r`n" + "Installing Hyper-V" + Write-Host "Installing Hyper-V..." + $ResultText.text = "`r`n" +"`r`n" + "Installing Hyper-V..." Enable-WindowsOptionalFeature -Online -FeatureName "HypervisorPlatform" -All Enable-WindowsOptionalFeature -Online -FeatureName "VirtualMachinePlatform" -All Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Windows-Subsystem-Linux" -All @@ -1930,6 +1944,9 @@ $Virtualization.Add_Click({ }) $windowsupdatefix.Add_Click({ + Write-Host "Repairing/Resetting Windows Update..." + $ResultText.text = "`r`n" +"`r`n" + "Repairing/Resetting Windows Update..." + Write-Host "1. Stopping Windows Update Services..." Stop-Service -Name BITS Stop-Service -Name wuauserv @@ -2024,6 +2041,9 @@ $windowsupdatefix.Add_Click({ }) $disableupdates.Add_Click({ + Write-Host "Disabling Windows Update..." + $ResultText.text = "`r`n" +"`r`n" + "Disabling Windows Update..." + # Source: https://github.com/rgl/windows-vagrant/blob/master/disable-windows-updates.ps1 Set-StrictMode -Version Latest $ProgressPreference = 'SilentlyContinue' @@ -2104,9 +2124,15 @@ $disableupdates.Add_Click({ Write-Host "Setting $service StartupType to Disabled" Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Disabled } + + Write-Host "Windows Update disabled." + $ResultText.text = "`r`n" +"`r`n" + "Windows Update disabled." }) $enableupdates.Add_Click({ + Write-Host "Enabling Windows Update..." + $ResultText.text = "`r`n" +"`r`n" + "Enabling Windows Update..." + # Source: https://github.com/rgl/windows-vagrant/blob/master/disable-windows-updates.ps1 Set-StrictMode -Version Latest $ProgressPreference = 'SilentlyContinue' @@ -2185,6 +2211,9 @@ $enableupdates.Add_Click({ Write-Host "Setting $service StartupType to Automatic" Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Automatic } + + Write-Host "Windows Update enabled." + $ResultText.text = "`r`n" +"`r`n" + "Windows Update enabled." }) [void]$Form.ShowDialog() From cf10081f91f1d21f9fb04ee44ea86a809807fc06 Mon Sep 17 00:00:00 2001 From: Carterpersall Date: Sun, 24 Apr 2022 09:03:19 -0500 Subject: [PATCH 10/12] A few comments - Added a few comments labeling each section of the script --- win10debloat.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/win10debloat.ps1 b/win10debloat.ps1 index 7353709b..8b85373a 100644 --- a/win10debloat.ps1 +++ b/win10debloat.ps1 @@ -28,6 +28,8 @@ else{ $ResultText.text = "`r`n" +"`r`n" + "Winget Installed - Ready for Next Task" } +# GUI Specs + $Form = New-Object system.Windows.Forms.Form $Form.ClientSize = New-Object System.Drawing.Point(1050,1000) $Form.text = "Windows Toolbox By Chris Titus" @@ -51,6 +53,8 @@ $Form.Icon = [System.Drawing.Icon]::FromHandle((New-Object Sy $Form.Width = $objImage.Width $Form.Height = $objImage.Height +# GUI Objects + $Panel1 = New-Object system.Windows.Forms.Panel $Panel1.height = 939 $Panel1.width = 219 @@ -666,6 +670,8 @@ $Panel2.controls.AddRange(@($essentialtweaks,$backgroundapps,$cortana,$actioncen $Panel4.controls.AddRange(@($defaultwindowsupdate,$securitywindowsupdate,$Label16,$Label17,$Label18,$Label19,$windowsupdatefix,$disableupdates,$enableupdates,$Label12)) $Panel3.controls.AddRange(@($yourphonefix,$ncpa,$oldcontrolpanel,$oldsoundpanel,$oldsystempanel,$NFS,$laptopnumlock,$Virtualization,$oldpower,$restorepower)) +# Functions/Scripts + $brave.Add_Click({ Write-Host "Installing Brave Browser" $ResultText.text = "`r`n" +"`r`n" + "Installing Brave... Please Wait" @@ -2216,4 +2222,4 @@ $enableupdates.Add_Click({ $ResultText.text = "`r`n" +"`r`n" + "Windows Update enabled." }) -[void]$Form.ShowDialog() +[void]$Form.ShowDialog() # Show GUI \ No newline at end of file From 03c82ee9e1138461968e07f162dfb6739f4aa3a6 Mon Sep 17 00:00:00 2001 From: Carterpersall Date: Fri, 29 Apr 2022 11:33:57 -0500 Subject: [PATCH 11/12] Add a bit to comments --- win10debloat.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/win10debloat.ps1 b/win10debloat.ps1 index 8b85373a..8be3b96b 100644 --- a/win10debloat.ps1 +++ b/win10debloat.ps1 @@ -1177,9 +1177,9 @@ $essentialtweaks.Add_Click({ "WpnService" # WpnService (Push Notifications may not work) #"wscsvc" # Windows Security Center Service "WSearch" # Windows Search - "XblAuthManager" # Xbox Live Auth Manager - "XblGameSave" # Xbox Live Game Save Service - "XboxNetApiSvc" # Xbox Live Networking Service + "XblAuthManager" # Xbox Live Auth Manager (Disabling Breaks Xbox Live Games) + "XblGameSave" # Xbox Live Game Save Service (Disabling Breaks Xbox Live Games) + "XboxNetApiSvc" # Xbox Live Networking Service (Disabling Breaks Xbox Live Games) "XboxGipSvc" # Xbox Accessory Management Service # Hp services "HPAppHelperCap" From 45ffb38e7b2ccb95ba94dd522e248aa4081df883 Mon Sep 17 00:00:00 2001 From: Carterpersall Date: Fri, 29 Apr 2022 12:06:34 -0500 Subject: [PATCH 12/12] Change OOSU config Comment - Changed ooshutup10.cfg comments to reflect the current version --- ooshutup10.cfg | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ooshutup10.cfg b/ooshutup10.cfg index 55c37e6b..fa2291c0 100644 --- a/ooshutup10.cfg +++ b/ooshutup10.cfg @@ -1,18 +1,20 @@ ############################################################################ -# This file was created with O&O ShutUp10 and can be imported onto another computer. +# This file was created with O&O ShutUp10++ +# and can be imported onto another computer. # # Download the application at https://www.oo-software.com/shutup10 # You can then import the file from within the program. # -# Alternatively you can import it automatically over a command line. Simply use -# the following parameter: -# ooshutup10.exe +# Alternatively you can import it automatically over a command line. +# Simply use the following parameter: +# OOSU10.exe # -# Selecting the Option /quiet ends the app right after the import and the user does not -# get any feedback about the import. +# Selecting the Option /quiet ends the app right after the import and the +# user does not get any feedback about the import. # # We are always happy to answer any questions you may have! -# © 2015-2020 O&O Software GmbH, Berlin. All rights reserved. https://www.oo-software.com/ +# © 2015-2022 O&O Software GmbH, Berlin. All rights reserved. +# https://www.oo-software.com/ ############################################################################ P001 +