Remove unused files

- Try to lower file sizes
- Fix Revert Tweaks not reverting .reg files
- Re-arrange some tweaks
- Add Explanation to user for some tweaks
- Don't Revert IIS on Services anymore (Good)
- Don't use Global Variables to Registry Paths
main
Plínio Larrubia 3 years ago committed by Plínio Larrubia
parent 9cabded31c
commit 4ee26f1dea
No known key found for this signature in database
GPG Key ID: 057B0A87CB137C69

@ -88,7 +88,7 @@ Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force; ls -Recurse *.ps*1 |
- `Remove Xbox from Windows`: Wipe Xbox Apps, disable Services related to Xbox and GameBar/GameDVR; ([`remove-and-disable-xbox.ps1`](./src/scripts/remove-and-disable-xbox.ps1))
- `Repair Windows`: Try to Completely fix the Windows worst problems via Command Line; ([`backup-system.ps1`](./src/scripts/backup-system.ps1) and [`repair-windows.ps1`](./src/scripts/repair-windows.ps1))
- `Reinstall Pre-Installed Apps`: Rebloat Windows with all the Pre-Installed Apps; ([`reinstall-pre-installed-apps.ps1`](./src/utils/reinstall-pre-installed-apps.ps1))
- `Revert Tweaks`: Re-apply some tweaks and [Revert] all possible ones, covering the `Scheduled Tasks`, `Services`, `Privacy and Performance`, `Personal` and `Optional Features` tweaks;
- `Revert Tweaks`: Re-apply some tweaks and [Revert] all possible ones, covering the `Scheduled Tasks`, `Services`, `Privacy and Performance`, `Personal` and `Optional Features` tweaks, then try to `Reinstall Pre-Installed Apps`;
- `Dark Theme & Light Theme`: Apply [Dark Theme](./src/utils/use-dark-theme.reg) or [Light Theme](./src/utils/use-light-theme.reg) on Windows;
- `Enable/Disable Search Indexing`: Let you choose whether the **Windows Search Service** is [enabled](./src/utils/enable-search-idx.ps1) or [disabled](src/utils/disable-search-idx.ps1);
- `Enable/Disable Background Apps`: Let you choose whether _ALL_ the **Background Apps** are [enabled](./src/utils/enable-bg-apps.reg) or [disabled](src/utils/disable-bg-apps.reg);

@ -6,7 +6,6 @@ function Request-AdminPrivilege() {
# https://docs.microsoft.com/en-us/powershell/scripting/samples/creating-a-custom-input-box?view=powershell-7.1
# Adapted majorly from https://github.com/ChrisTitusTech/win10script and https://github.com/Sycnex/Windows10Debloater
function Show-GUI() {
Set-GUILayout # Load the GUI Layout
$Global:NeedRestart = $false
@ -21,7 +20,7 @@ function Show-GUI() {
$Form.MaximizeBox = $false # Hide the Maximize Button
$Form.Size = New-Object System.Drawing.Size(($FormWidth + 15), $FormHeight)
$Form.StartPosition = 'CenterScreen' # Appears on the center
$Form.Text = "Win 10+ Smart Debloat Tools | $(Get-SystemSpec) | Made by LeDragoX"
$Form.Text = "Win 10+ Smart Debloat Tools | $(Get-SystemSpec) | Made by LeDragoX" # Loading the specs takes longer to load the script
$Form.TopMost = $false
# Icon: https://stackoverflow.com/a/53377253
@ -476,14 +475,11 @@ function Show-GUI() {
# Add all Panels to the Form (Screen)
$Form.Controls.AddRange(@($FullPanel))
# Add Elements to each Panel
$FullPanel.Controls.AddRange(@($TitleLabel3, $CaptionLabel1))
$FullPanel.Controls.AddRange(@($Panel1, $Panel2, $Panel3, $Panel4))
$Panel1.Controls.AddRange(@($TitleLabel1, $ApplyTweaks, $RemoveXbox, $RepairWindows, $InstallOneDrive, $ReinstallBloatApps, $PictureBox1))
$Panel2.Controls.AddRange(@($TitleLabel2, $RevertScript, $DarkTheme, $LightTheme, $EnableSearchIdx, $DisableSearchIdx, $EnableBgApps, $DisableBgApps, $EnableTelemetry, $DisableTelemetry, $EnableCortana, $DisableCortana, $EnableGameBarAndDVR, $DisableGameBarAndDVR, $EnableClipboardHistory, $DisableClipboardHistory, $EnableOldVolumeControl, $DisableOldVolumeControl))
$Panel3.Controls.AddRange(@($InstallDrivers, $CaptionLabel3_1, $BraveBrowser, $GoogleChrome, $MozillaFirefox))
$Panel3.Controls.AddRange(@($CaptionLabel3_2, $7Zip, $WinRAR))
$Panel3.Controls.AddRange(@($CaptionLabel3_3, $OnlyOffice, $LibreOffice, $PowerBI))
@ -495,7 +491,6 @@ function Show-GUI() {
$Panel3.Controls.AddRange(@($CaptionLabel3_9, $TwilioAuthy))
$Panel3.Controls.AddRange(@($CaptionLabel3_10, $Ventoy, $Rufus, $BalenaEtcher))
$Panel3.Controls.AddRange(@($CaptionLabel3_11, $WindowsTerminalNerdFonts, $GitGnupgSshSetup, $JavaJRE, $JavaJDKs, $NodeJsLts, $NodeJs, $Python3, $Anaconda3, $Ruby, $ADB, $AndroidStudio, $DockerDesktop, $PostgreSQL, $MySQL, $Insomnia))
$Panel4.Controls.AddRange(@($InstallGamingDependencies, $CaptionLabel4_1, $Discord, $MSTeams, $Slack, $Zoom, $Telegram, $RocketChat))
$Panel4.Controls.AddRange(@($CaptionLabel4_2, $Steam, $GogGalaxy, $EpicGames, $EADesktop, $UbisoftConnect, $BorderlessGaming))
$Panel4.Controls.AddRange(@($CaptionLabel4_3, $Notion))
@ -549,12 +544,12 @@ function Show-GUI() {
$ReinstallBloatApps.Add_Click( {
$Scripts = @("reinstall-pre-installed-apps.ps1")
Open-PowerShellFilesCollection -RelativeLocation "src\utils" -Scripts $Scripts -DoneTitle $DoneTitle -DoneMessage $DoneMessage
Open-PowerShellFilesCollection -RelativeLocation "src\scripts" -Scripts $Scripts -DoneTitle $DoneTitle -DoneMessage $DoneMessage
})
$RevertScript.Add_Click( {
$Global:Revert = $true
$Scripts = @("optimize-scheduled-tasks.ps1", "optimize-services.ps1", "optimize-privacy-and-performance.ps1", "personal-tweaks.ps1", "optimize-optional-features.ps1")
$Scripts = @("optimize-scheduled-tasks.ps1", "optimize-services.ps1", "optimize-privacy-and-performance.ps1", "personal-tweaks.ps1", "optimize-optional-features.ps1", "reinstall-pre-installed-apps.ps1")
Open-PowerShellFilesCollection -RelativeLocation "src\scripts" -Scripts $Scripts -DoneTitle $DoneTitle -DoneMessage $DoneMessage
$Global:Revert = $false
})
@ -981,12 +976,8 @@ function Show-GUI() {
Open-PowerShellFilesCollection -RelativeLocation "src\utils" -Scripts $Scripts -DoneTitle $DoneTitle -DoneMessage $DoneMessage
})
# Show the Window
[void]$Form.ShowDialog()
# When done, dispose of the GUI
$Form.Dispose()
[void]$Form.ShowDialog() # Show the Window
$Form.Dispose() # When done, dispose of the GUI
}
function Main() {

@ -19,12 +19,10 @@ function Install-PackageManager() {
)
Try {
$err = $null
$err = (Invoke-Expression "$CheckExistenceBlock")
if (($LASTEXITCODE)) { throw $err } # 0 = False, 1 = True
Write-Warning "[?] $PackageManagerFullName is already installed."
}
Catch {
Write-Warning "[?] $PackageManagerFullName was not found."
@ -109,7 +107,6 @@ function Main() {
Install-PackageManager -PackageManagerFullName $WingetParams[0] -CheckExistenceBlock $WingetParams[1] -InstallCommandBlock $WingetParams[2] -Time $WingetParams[3] -UpdateScriptBlock $WingetParams[4]
# Install Chocolatey on Windows
Install-PackageManager -PackageManagerFullName $ChocolateyParams[0] -CheckExistenceBlock $ChocolateyParams[1] -InstallCommandBlock $ChocolateyParams[2] -Time $ChocolateyParams[3] -UpdateScriptBlock $ChocolateyParams[4] -PostInstallBlock $ChocolateyParams[5]
}
Main

@ -4,7 +4,6 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
function Optimize-OptionalFeaturesList() {
Write-Title -Text "Uninstall features from Windows"
# Dism /online /Get-Features #/Format:Table # To find all features
# Get-WindowsOptionalFeature -Online
@ -20,17 +19,16 @@ function Optimize-OptionalFeaturesList() {
"WorkFolders-Client" # Work Folders Client
)
ForEach ($Feature in $DisableFeatures) {
If (Get-WindowsOptionalFeature -Online -FeatureName $Feature) {
Write-Host "$($EnableStatus[0]) $Feature..."
If (($Revert -eq $true) -and ($Feature -like "IIS-*")) {
Write-Warning "[?][Features] Skipping $Feature to avoid a security vulnerability ..."
Continue
}
Write-Host "$($EnableStatus[0]) $Feature ..."
Invoke-Expression "$($Commands[0])"
}
Else {
Write-Warning "[?][Features] $Feature was not found."
}
}
@ -47,17 +45,12 @@ function Optimize-OptionalFeaturesList() {
)
ForEach ($Feature in $EnableFeatures) {
If (Get-WindowsOptionalFeature -Online -FeatureName $Feature) {
Write-Host "[+][Features] Installing $Feature..."
Write-Host "[+][Features] Installing $Feature ..."
Get-WindowsOptionalFeature -Online -FeatureName $Feature | Where-Object State -Like "Disabled*" | Enable-WindowsOptionalFeature -Online -NoRestart
}
Else {
Write-Warning "[?][Features] $Feature was not found."
}
}
}
@ -78,7 +71,6 @@ function Main() {
If (($Revert)) {
Write-Warning "[<][Features] Reverting: $Revert."
$EnableStatus = @(
"[<][Features] Re-Installing",
"[<][Features] Re-Uninstalling"
@ -87,12 +79,10 @@ function Main() {
"Disabled*",
"Enabled"
)
$Commands = @(
{ Get-WindowsOptionalFeature -Online -FeatureName $Feature | Where-Object State -Like "$($FeatureState[0])" | Enable-WindowsOptionalFeature -Online -NoRestart },
{ Get-WindowsOptionalFeature -Online -FeatureName $Feature | Where-Object State -Like "$($FeatureState[1])" | Disable-WindowsOptionalFeature -Online -NoRestart }
)
}
Optimize-OptionalFeaturesList # Disable useless features and Enable features claimed as Optional on Windows, but actually, they are useful

@ -1,3 +1,4 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"file-runner.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
# Adapted from: https://youtu.be/qWESrvP_uU8
@ -8,35 +9,34 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
function Optimize-PrivacyAndPerformance() {
# Initialize all Path variables used to Registry Tweaks
$Global:PathToLMActivityHistory = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System"
$Global:PathToLMAutoLogger = "HKLM:\SYSTEM\CurrentControlSet\Control\WMI\AutoLogger"
$Global:PathToLMDeliveryOptimizationCfg = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config"
$Global:PathToLMPoliciesAdvertisingInfo = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo"
$Global:PathToLMPoliciesCloudContent = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent"
$Global:PathToLMPoliciesGameDVR = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR"
$Global:PathToLMPoliciesPsched = "HKLM:\SOFTWARE\Policies\Microsoft\Psched"
$Global:PathToLMPoliciesSQMClient = "HKLM:\SOFTWARE\Policies\Microsoft\SQMClient\Windows"
$Global:PathToLMPoliciesTelemetry = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection"
$Global:PathToLMPoliciesTelemetry2 = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection"
$Global:PathToLMPoliciesToWifi = "HKLM:\Software\Microsoft\PolicyManager\default\WiFi"
$Global:PathToLMPoliciesWindowsStore = "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore"
$Global:PathToLMPoliciesWindowsUpdate = "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU"
$Global:PathToLMPrefetchParams = "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters"
$Global:PathToLMWindowsTroubleshoot = "HKLM:\SOFTWARE\Microsoft\WindowsMitigation"
$Global:PathToCUContentDeliveryManager = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"
$Global:PathToCUDeviceAccessGlobal = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global"
$Global:PathToCUGameBar = "HKCU:\SOFTWARE\Microsoft\GameBar"
$Global:PathToCUInputPersonalization = "HKCU:\SOFTWARE\Microsoft\InputPersonalization"
$Global:PathToCUInputTIPC = "HKCU:\SOFTWARE\Microsoft\Input\TIPC"
$Global:PathToCUOnlineSpeech = "HKCU:\SOFTWARE\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy"
$Global:PathToCUPoliciesCloudContent = "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent"
$Global:PathToCUSearch = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search"
$Global:PathToCUSiufRules = "HKCU:\SOFTWARE\Microsoft\Siuf\Rules"
$PathToLMActivityHistory = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System"
$PathToLMAutoLogger = "HKLM:\SYSTEM\CurrentControlSet\Control\WMI\AutoLogger"
$PathToLMDeliveryOptimizationCfg = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config"
$PathToLMPoliciesAdvertisingInfo = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo"
$PathToLMPoliciesCloudContent = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent"
$PathToLMPoliciesGameDVR = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR"
$PathToLMPoliciesPsched = "HKLM:\SOFTWARE\Policies\Microsoft\Psched"
$PathToLMPoliciesSQMClient = "HKLM:\SOFTWARE\Policies\Microsoft\SQMClient\Windows"
$PathToLMPoliciesTelemetry = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection"
$PathToLMPoliciesTelemetry2 = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection"
$PathToLMPoliciesToWifi = "HKLM:\Software\Microsoft\PolicyManager\default\WiFi"
$PathToLMPoliciesWindowsStore = "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore"
$PathToLMPoliciesWindowsUpdate = "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU"
$PathToLMPrefetchParams = "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters"
$PathToLMWindowsTroubleshoot = "HKLM:\SOFTWARE\Microsoft\WindowsMitigation"
$PathToCUContentDeliveryManager = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"
$PathToCUDeviceAccessGlobal = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global"
$PathToCUGameBar = "HKCU:\SOFTWARE\Microsoft\GameBar"
$PathToCUInputPersonalization = "HKCU:\SOFTWARE\Microsoft\InputPersonalization"
$PathToCUInputTIPC = "HKCU:\SOFTWARE\Microsoft\Input\TIPC"
$PathToCUOnlineSpeech = "HKCU:\SOFTWARE\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy"
$PathToCUPoliciesCloudContent = "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent"
$PathToCUSearch = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search"
$PathToCUSiufRules = "HKCU:\SOFTWARE\Microsoft\Siuf\Rules"
Write-Title -Text "Privacy And Performance Tweaks"
Write-Section -Text "Personalization"
Write-Caption -Text "? & ? & Start & Lockscreen"
Write-Caption -Text "Start & Lockscreen"
Write-Host "$($EnableStatus[0]) Show me the windows welcome experience after updates..."
Write-Host "$($EnableStatus[0]) 'Get fun facts and tips, etc. on lock screen'..."
@ -82,7 +82,6 @@ function Optimize-PrivacyAndPerformance() {
Write-Section -Text "Privacy -> Windows Permissions"
Write-Caption -Text "General"
Write-Host "$($EnableStatus[0]) Let apps use my advertising ID..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled" -Type DWord -Value $Zero
If (!(Test-Path "$PathToLMPoliciesAdvertisingInfo")) {
@ -94,25 +93,22 @@ function Optimize-PrivacyAndPerformance() {
Set-ItemProperty -Path "HKCU:\Control Panel\International\User Profile" -Name "HttpAcceptLanguageOptOut" -Type DWord -Value $One
Write-Caption -Text "Speech"
# [@] (0 = Decline, 1 = Accept)
Write-Host "$($EnableStatus[0]) Online Speech Recognition..."
If (!(Test-Path "$PathToCUOnlineSpeech")) {
New-Item -Path "$PathToCUOnlineSpeech" -Force | Out-Null
}
# [@] (0 = Decline, 1 = Accept)
Set-ItemProperty -Path "$PathToCUOnlineSpeech" -Name "HasAccepted" -Type DWord -Value $Zero
Write-Caption -Text "Inking & Typing Personalization"
Set-ItemProperty -Path "$PathToCUInputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value $Zero
Set-ItemProperty -Path "$PathToCUInputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value $One
Set-ItemProperty -Path "$PathToCUInputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value $One
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value $Zero
Write-Caption -Text "Diagnostics & Feedback"
# [@] (0 = Security (Enterprise only), 1 = Basic Telemetry, 2 = Enhanced Telemetry, 3 = Full Telemetry)
Write-Host "$($EnableStatus[0]) telemetry..."
# [@] (0 = Security (Enterprise only), 1 = Basic Telemetry, 2 = Enhanced Telemetry, 3 = Full Telemetry)
Set-ItemProperty -Path "$PathToLMPoliciesTelemetry" -Name "AllowTelemetry" -Type DWord -Value $Zero
Set-ItemProperty -Path "$PathToLMPoliciesTelemetry2" -Name "AllowTelemetry" -Type DWord -Value $Zero
Set-ItemProperty -Path "$PathToLMPoliciesTelemetry" -Name "AllowDeviceNameInTelemetry" -Type DWord -Value $Zero
@ -139,7 +135,6 @@ function Optimize-PrivacyAndPerformance() {
Set-ItemProperty -Path "$PathToCUSiufRules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value $Zero
Write-Caption -Text "Activity History"
Write-Host "$($EnableStatus[0]) Activity History..."
$ActivityHistoryDisableOnZero = @(
"EnableActivityFeed"
@ -155,33 +150,28 @@ function Optimize-PrivacyAndPerformance() {
Write-Section -Text "Privacy -> Apps Permissions"
Write-Caption -Text "Location"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Value "Deny"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Value "Deny"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value $Zero
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "EnableStatus" -Type DWord -Value $Zero
Write-Caption -Text "Notifications"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userNotificationListener" -Name "Value" -Value "Deny"
Write-Caption -Text "App Diagnostics"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics" -Name "Value" -Value "Deny"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics" -Name "Value" -Value "Deny"
Write-Caption -Text "Account Info Access"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userAccountInformation" -Name "Value" -Value "Deny"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userAccountInformation" -Name "Value" -Value "Deny"
Write-Caption -Text "Other Devices"
# Disable sharing information with unpaired devices
Write-Host "[-][Priv&Perf] Denying device access..."
If (!(Test-Path "$PathToCUDeviceAccessGlobal\LooselyCoupled")) {
New-Item -Path "$PathToCUDeviceAccessGlobal\LooselyCoupled" -Force | Out-Null
}
# Disable sharing information with unpaired devices
Set-ItemProperty -Path "$PathToCUDeviceAccessGlobal\LooselyCoupled" -Name "Value" -Value "Deny"
ForEach ($key in (Get-ChildItem "$PathToCUDeviceAccessGlobal")) {
If ($key.PSChildName -EQ "LooselyCoupled") {
@ -192,50 +182,44 @@ function Optimize-PrivacyAndPerformance() {
}
Write-Caption -Text "Background Apps"
Write-Host "$($EnableStatus[0]) Background Apps..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Name "GlobalUserDisabled" -Type DWord -Value $One
Set-ItemProperty -Path "$PathToCUSearch" -Name "BackgroundAppGlobalToggle" -Type DWord -Value $Zero
Write-Section -Text "Update & Security"
Write-Caption -Text "Windows Update"
Write-Host "[-][Priv&Perf] Disabling Automatic Download and Installation of Windows Updates..."
If (!(Test-Path "$PathToLMPoliciesWindowsUpdate")) {
New-Item -Path "$PathToLMPoliciesWindowsUpdate" -Force | Out-Null
}
# [@] (2 = Notify before download, 3 = Automatically download and notify of installation)
# [@] (4 = Automatically download and schedule installation, 5 = Automatic Updates is required and users can configure it)
Write-Host "[-][Priv&Perf] Disabling Automatic Download and Installation of Windows Updates..."
Set-ItemProperty -Path "$PathToLMPoliciesWindowsUpdate" -Name "AUOptions" -Type DWord -Value 2
# [@] (0 = Enable Automatic Updates, 1 = Disable Automatic Updates)
Write-Host "$($EnableStatus[1]) Automatic Updates..."
# [@] (0 = Enable Automatic Updates, 1 = Disable Automatic Updates)
Set-ItemProperty -Path "$PathToLMPoliciesWindowsUpdate" -Name "NoAutoUpdate" -Type DWord -Value $Zero
# [@] (0 = Every day, 1~7 = The days of the week from Sunday (1) to Saturday (7) (Only valid if AUOptions = 4))
Write-Host "[+][Priv&Perf] Setting Scheduled Day to Every day..."
# [@] (0 = Every day, 1~7 = The days of the week from Sunday (1) to Saturday (7) (Only valid if AUOptions = 4))
Set-ItemProperty -Path "$PathToLMPoliciesWindowsUpdate" -Name "ScheduledInstallDay" -Type DWord -Value 0
# [@] (0-23 = The time of day in 24-hour format)
Write-Host "[-][Priv&Perf] Setting Scheduled time to 03h00m..."
# [@] (0-23 = The time of day in 24-hour format)
Set-ItemProperty -Path "$PathToLMPoliciesWindowsUpdate" -Name "ScheduledInstallTime" -Type DWord -Value 3
Write-Host "[=] Enabling automatic driver updates..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching" -Name "SearchOrderConfig" -Type DWord -Value 1
Write-Host "$($EnableStatus[1]) Change Windows Updates to 'Notify to schedule restart'..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value $One
# [@] (0 = Off, 1 = Local Network only, 2 = Local Network private peering only)
# [@] (3 = Local Network and Internet, 99 = Simply Download mode, 100 = Bypass mode)
Write-Host "$($EnableStatus[1]) Restricting Windows Update P2P downloads for Local Network only..."
If (!(Test-Path "$PathToLMDeliveryOptimizationCfg")) {
New-Item -Path "$PathToLMDeliveryOptimizationCfg" -Force | Out-Null
}
# [@] (0 = Off, 1 = Local Network only, 2 = Local Network private peering only)
# [@] (3 = Local Network and Internet, 99 = Simply Download mode, 100 = Bypass mode)
Set-ItemProperty -Path "$PathToLMDeliveryOptimizationCfg" -Name "DODownloadMode" -Type DWord -Value $One
Write-Caption -Text "Troubleshooting"
Write-Host "[+][Priv&Perf] Enabling Automatic Recommended Troubleshooting, then notify me..."
If (!(Test-Path "$PathToLMWindowsTroubleshoot")) {
New-Item -Path "$PathToLMWindowsTroubleshoot" -Force | Out-Null
@ -273,7 +257,13 @@ function Optimize-PrivacyAndPerformance() {
Set-ItemProperty -Path "$PathToLMPoliciesCloudContent" -Name "DisableThirdPartySuggestions" -Type DWord -Value $One
Set-ItemProperty -Path "$PathToLMPoliciesCloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value $One
# Reference: https://forums.guru3d.com/threads/windows-10-registry-tweak-for-disabling-drivers-auto-update-controversy.418033/
Write-Host "$($EnableStatus[0]) automatic driver updates..."
# [@] (0 = Yes, do this automatically, 1 = No, let me choose what to do, Always install the best, 2 = [...] Install driver software from Windows Update, 3 = [...] Never install driver software from Windows Update
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -Type DWord -Value $One
# [@] (0 = Enhanced icons enabled, 1 = Enhanced icons disabled)
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching" -Name "SearchOrderConfig" -Type DWord -Value $One
If (!(Test-Path "$PathToLMPoliciesSQMClient")) {
New-Item -Path "$PathToLMPoliciesSQMClient" -Force | Out-Null
}
@ -302,23 +292,19 @@ function Optimize-PrivacyAndPerformance() {
Set-ItemProperty -Path "$PathToLMPoliciesToWifi\AllowAutoConnectToWiFiSenseHotspots" -Name "value" -Type DWord -Value $Zero
Write-Section -Text "Gaming"
Write-Host "$($EnableStatus[0]) Game Bar & Game DVR..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\ApplicationManagement\AllowGameDVR" -Name "value" -Type DWord -Value $Zero
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR" -Name "AppCaptureEnabled" -Type DWord -Value $Zero
Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_Enabled" -Type DWord -Value $Zero
If (!(Test-Path "$PathToLMPoliciesGameDVR")) {
New-Item -Path "$PathToLMPoliciesGameDVR" -Force | Out-Null
$Scripts = @("disable-game-bar-dvr.reg")
If ($Revert) {
$Scripts = @("enable-game-bar-dvr.reg")
}
Set-ItemProperty -Path "$PathToLMPoliciesGameDVR" -Name "AllowGameDVR" -Type DWord -Value $Zero
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts $Scripts -DoneTitle "" -DoneMessage "" -NoDialog
Write-Host "$($EnableStatus[1]) game mode..."
Set-ItemProperty -Path "$PathToCUGameBar" -Name "AllowAutoGameMode" -Type DWord -Value $One
Set-ItemProperty -Path "$PathToCUGameBar" -Name "AutoGameModeEnabled" -Type DWord -Value $One
Write-Host "[=][Priv&Perf] Enabling game mode..."
Set-ItemProperty -Path "$PathToCUGameBar" -Name "AllowAutoGameMode" -Type DWord -Value 1
Set-ItemProperty -Path "$PathToCUGameBar" -Name "AutoGameModeEnabled" -Type DWord -Value 1
Write-Section -Text "System"
Write-Caption -Text "Display"
Write-Host "[+][Priv&Perf] Enable Hardware Accelerated GPU Scheduling... (Windows 10 20H1+ - Needs Restart)"
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name "HwSchMode" -Type DWord -Value 2
@ -334,7 +320,6 @@ function Optimize-PrivacyAndPerformance() {
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Name "Preferences" -Type Binary -Value $preferences.Preferences
Write-Caption "Deleting useless registry keys..."
$KeysToDelete = @(
# Remove Background Tasks
"HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y"
@ -370,10 +355,9 @@ function Optimize-PrivacyAndPerformance() {
}
Write-Title -Text "Performance Tweaks"
Write-Host "$($EnableStatus[0]) SysMain/Superfetch..."
# As SysMain was already disabled on the Services, just need to remove it's key
# [@] (0 = Disable SysMain, 1 = Enable when program is launched, 2 = Enable on Boot, 3 = Enable on everything)
Write-Host "$($EnableStatus[0]) SysMain/Superfetch..."
Set-ItemProperty -Path "$PathToLMPrefetchParams" -Name "EnableSuperfetch" -Type DWord -Value $Zero
Write-Host "$($EnableStatus[0]) Remote Assistance..."
@ -394,18 +378,16 @@ function Optimize-PrivacyAndPerformance() {
}
Set-ItemProperty -Path "$PathToLMPoliciesPsched" -Name "NonBestEffortLimit" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" -Name "NetworkThrottlingIndex" -Type DWord -Value 0xffffffff
# [@] (2 = Disable, 4 = Enable)
Write-Host "[=][Priv&Perf] Enabling Windows Store apps Automatic Updates..."
If (!(Test-Path "$PathToLMPoliciesWindowsStore")) {
New-Item -Path "$PathToLMPoliciesWindowsStore" -Force | Out-Null
}
If ((Get-Item "$PathToLMPoliciesWindowsStore").GetValueNames() -like "AutoDownload") {
Remove-ItemProperty -Path "$PathToLMPoliciesWindowsStore" -Name "AutoDownload"
Remove-ItemProperty -Path "$PathToLMPoliciesWindowsStore" -Name "AutoDownload" # [@] (2 = Disable, 4 = Enable)
}
Write-Section -Text "Power Plan Tweaks"
Write-Host "[+][Priv&Perf] Setting Power Plan to High Performance..."
powercfg -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
@ -415,9 +397,8 @@ function Optimize-PrivacyAndPerformance() {
Write-Section -Text "Network & Internet"
Write-Caption -Text "Proxy"
# Code from: https://www.reddit.com/r/PowerShell/comments/5iarip/set_proxy_settings_to_automatically_detect/?utm_source=share&utm_medium=web2x&context=3
Write-Host "[-][Priv&Perf] Fixing Edge slowdown by NOT Automatically Detecting Settings..."
# Code from: https://www.reddit.com/r/PowerShell/comments/5iarip/set_proxy_settings_to_automatically_detect/?utm_source=share&utm_medium=web2x&context=3
$key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections'
$data = (Get-ItemProperty -Path $key -Name DefaultConnectionSettings).DefaultConnectionSettings
$data[8] = 3
@ -434,7 +415,6 @@ function Main() {
If (($Revert)) {
Write-Warning "[<][Priv&Perf] Reverting: $Revert."
$Zero = 1
$One = 0
$EnableStatus = @(

@ -41,7 +41,7 @@ function Optimize-ScheduledTasksList() {
ForEach ($ScheduledTask in $DisableScheduledTasks) {
If (Get-ScheduledTaskInfo -TaskName $ScheduledTask -ErrorAction SilentlyContinue) {
Write-Host "$($EnableStatus[0]) the $ScheduledTask Task..."
Write-Host "$($EnableStatus[0]) the $ScheduledTask Task ..."
Invoke-Expression "$($Commands[0])"
}
Else {
@ -57,7 +57,7 @@ function Optimize-ScheduledTasksList() {
ForEach ($ScheduledTask in $EnableScheduledTasks) {
If (Get-ScheduledTaskInfo -TaskName $ScheduledTask -ErrorAction SilentlyContinue) {
Write-Host "[+][TaskScheduler] Enabling the $ScheduledTask Task..."
Write-Host "[+][TaskScheduler] Enabling the $ScheduledTask Task ..."
Get-ScheduledTask -TaskName "$ScheduledTask".Split("\")[-1] | Where-Object State -Like "Disabled" | Enable-ScheduledTask
}
Else {
@ -78,7 +78,6 @@ function Main() {
If (($Revert)) {
Write-Warning "[<][TaskScheduler] Reverting: $Revert."
$EnableStatus = @(
"[<][TaskScheduler] Re-Enabling",
"[<][TaskScheduler] Re-Disabling"

@ -8,10 +8,10 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
function Optimize-Security() {
$CPU = Get-CPU -NameOnly
# Initialize all Path variables used to Registry Tweaks
$Global:PathToLMPoliciesEdge = "HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge"
$Global:PathToLMPoliciesMRT = "HKLM:\SOFTWARE\Policies\Microsoft\MRT"
$Global:PathToCUExplorer = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer"
$Global:PathToCUExplorerAdvanced = "$PathToCUExplorer\Advanced"
$PathToLMPoliciesEdge = "HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge"
$PathToLMPoliciesMRT = "HKLM:\SOFTWARE\Policies\Microsoft\MRT"
$PathToCUExplorer = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer"
$PathToCUExplorerAdvanced = "$PathToCUExplorer\Advanced"
Write-Title -Text "Security Tweaks"
Write-Warning "if you already use another antivirus, nothing will happen."

@ -66,11 +66,11 @@ function Optimize-RunningServicesList() {
ForEach ($Service in $DisableServices) {
If (Get-Service $Service -ErrorAction SilentlyContinue) {
If (($Revert -eq $true) -and ($Service -match "RemoteRegistry")) {
Write-Warning "[?][Services] Skipping $Service to avoid a security vulnerability..."
If (($Revert -eq $true) -and ($Service -like "RemoteRegistry")) {
Write-Warning "[?][Services] Skipping $Service to avoid a security vulnerability ..."
Continue
}
Write-Host "$($EnableStatus[0]) $Service at Startup..."
Write-Host "$($EnableStatus[0]) $Service at Startup ..."
Invoke-Expression "$($Commands[0])"
}
Else {
@ -85,7 +85,7 @@ function Optimize-RunningServicesList() {
)
ForEach ($Service in $EnableServicesSSD) {
Write-Host "$($EnableStatus[2]) $Service at Startup because SSDs will have more benefits..."
Write-Host "$($EnableStatus[2]) $Service at Startup because SSDs will have more benefits ..."
Invoke-Expression "$($Commands[2])"
}
}

@ -7,22 +7,23 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
function Register-PersonalTweaksList() {
# Initialize all Path variables used to Registry Tweaks
$Global:PathToCUAccessibility = "HKCU:\Control Panel\Accessibility"
$Global:PathToCUPoliciesEdge = "HKCU:\SOFTWARE\Policies\Microsoft\Edge"
$Global:PathToCUExplorer = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer"
$Global:PathToCUExplorerAdvanced = "$PathToCUExplorer\Advanced"
$Global:PathToCUPoliciesExplorer = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
$Global:PathToCUPoliciesLiveTiles = "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications"
$Global:PathToCUNewsAndInterest = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Feeds"
$Global:PathToCUSearch = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search"
$PathToCUAccessibility = "HKCU:\Control Panel\Accessibility"
$PathToCUPoliciesEdge = "HKCU:\SOFTWARE\Policies\Microsoft\Edge"
$PathToCUExplorer = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer"
$PathToCUExplorerAdvanced = "$PathToCUExplorer\Advanced"
$PathToCUPoliciesExplorer = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
$PathToCUPoliciesLiveTiles = "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications"
$PathToCUNewsAndInterest = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Feeds"
$PathToCUSearch = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search"
Write-Title -Text "My Personal Tweaks"
$Scripts = @("use-dark-theme.reg", "disable-cortana.reg", "enable-photo-viewer.reg", "disable-clipboard-history.reg")
If ($Revert) {
$Scripts = @("use-light-theme.reg", "enable-cortana.reg", "disable-photo-viewer.reg", "enable-clipboard-history.reg")
}
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts $Scripts -DoneTitle "" -DoneMessage "" -NoDialog
Write-Section -Text "Windows Explorer Tweaks"
Write-Host "[-][Personal] Hiding Quick Access from Windows Explorer..."
Set-ItemProperty -Path "$PathToCUExplorer" -Name "ShowFrequent" -Type DWord -Value $Zero
Set-ItemProperty -Path "$PathToCUExplorer" -Name "ShowRecent" -Type DWord -Value $Zero
@ -36,8 +37,8 @@ function Register-PersonalTweaksList() {
Remove-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" -Recurse
}
$Paint3DFileTypes = @(".3mf", ".bmp", ".fbx", ".gif", ".jfif", ".jpe", ".jpeg", ".jpg", ".png", ".tif", ".tiff")
Write-Host "[-][Personal] Removing 'Edit with Paint 3D' from the Context Menu..."
$Paint3DFileTypes = @(".3mf", ".bmp", ".fbx", ".gif", ".jfif", ".jpe", ".jpeg", ".jpg", ".png", ".tif", ".tiff")
ForEach ($FileType in $Paint3DFileTypes) {
If (Test-Path "Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\$FileType\Shell\3D Edit") {
Write-Host "[?][Personal] Removing Paint 3D from file type: $FileType."
@ -58,8 +59,8 @@ function Register-PersonalTweaksList() {
Write-Host "$($EnableStatus[0]) Aero-Shake Minimize feature..."
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "DisallowShaking" -Type DWord -Value $One
# [@] (1 = This PC, 2 = Quick access) # DO NOT REVERT (BREAKS EXPLORER.EXE)
Write-Host "[+][Personal] Setting Windows Explorer to start on This PC instead of Quick Access..."
# [@] (1 = This PC, 2 = Quick access) # DO NOT REVERT (BREAKS EXPLORER.EXE)
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "LaunchTo" -Type DWord -Value 1
Write-Host "$($EnableStatus[1]) Show hidden files in Explorer..."
@ -74,24 +75,23 @@ function Register-PersonalTweaksList() {
Write-Section -Text "Personalization"
Write-Section -Text "Task Bar Tweaks"
Write-Caption -Text "Task Bar - Windows 10 Compatible"
# [@] (0 = Hide completely, 1 = Show icon only, 2 = Show long Search Box)
Write-Host "[-][Personal] Hiding the search box from taskbar..."
# [@] (0 = Hide completely, 1 = Show icon only, 2 = Show long Search Box)
Set-ItemProperty -Path "$PathToCUSearch" -Name "SearchboxTaskbarMode" -Type DWord -Value $Zero
# [@] (0 = Hide Task view, 1 = Show Task view)
Write-Host "[-][Personal] Hiding the Task View from taskbar..."
# [@] (0 = Hide Task view, 1 = Show Task view)
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "ShowTaskViewButton" -Type DWord -Value $Zero
# [@] (0 = Disable, 1 = Enable)
Write-Host "$($EnableStatus[0]) Open on Hover from News and Interest from taskbar..."
If (!(Test-Path "$PathToCUNewsAndInterest")) {
New-Item -Path "$PathToCUNewsAndInterest" -Force | Out-Null
}
# [@] (0 = Disable, 1 = Enable)
Set-ItemProperty -Path "$PathToCUNewsAndInterest" -Name "ShellFeedsTaskbarOpenOnHover" -Type DWord -Value $Zero
# [@] (0 = Enable, 1 = Enable Icon only, 2 = Disable)
Write-Host "$($EnableStatus[0]) News and Interest from taskbar..."
# [@] (0 = Enable, 1 = Enable Icon only, 2 = Disable)
Set-ItemProperty -Path "$PathToCUNewsAndInterest" -Name "ShellFeedsTaskbarViewMode" -Type DWord -Value 2
Write-Host "[-][Personal] Hiding People icon..."
@ -116,52 +116,45 @@ function Register-PersonalTweaksList() {
Set-ItemProperty -Path "$PathToCUPoliciesExplorer" -Name "HideSCAMeetNow" -Type DWord -Value $One
Write-Caption -Text "Task Bar - Windows 11 Only"
# [@] (0 = Hide Widgets, 1 = Show Widgets)
Write-Host "[-][Personal] Hiding Widgets from taskbar..."
# [@] (0 = Hide Widgets, 1 = Show Widgets)
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "TaskbarDa" -Type DWord -Value $Zero
# Disable creation of Thumbs.db thumbnail cache files
Write-Host "$($EnableStatus[0]) creation of Thumbs.db..."
Write-Host "$($EnableStatus[0]) creation of Thumbs.db thumbnail cache files..."
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "DisableThumbnailCache" -Type DWord -Value $One
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "DisableThumbsDBOnNetworkFolders" -Type DWord -Value $One
Write-Caption -Text "Colors"
Write-Host "$($EnableStatus[0]) taskbar transparency..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "EnableTransparency" -Type DWord -Value $Zero
Write-Section -Text "System"
Write-Caption -Text "Multitasking"
Write-Host "[-][Personal] Disabling Edge multi tabs showing on Alt + Tab..."
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "MultiTaskingAltTabFilter" -Type DWord -Value 3
Write-Section -Text "Devices"
Write-Caption -Text "Bluetooth & other devices"
Write-Host "$($EnableStatus[1]) driver download over metered connections..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceSetup" -Name "CostedNetworkPolicy" -Type DWord -Value $One
Write-Section -Text "Cortana Tweaks"
Write-Host "$($EnableStatus[0]) Bing Search in Start Menu..."
Set-ItemProperty -Path "$PathToCUSearch" -Name "BingSearchEnabled" -Type DWord -Value $Zero
Set-ItemProperty -Path "$PathToCUSearch" -Name "CortanaConsent" -Type DWord -Value $Zero
Write-Section -Text "Ease of Access"
Write-Caption -Text "Keyboard"
Write-Output "[-][Personal] Disabling Sticky Keys..."
Write-Host "[-][Personal] Disabling Sticky Keys..."
Set-ItemProperty -Path "$PathToCUAccessibility\StickyKeys" -Name "Flags" -Value "506"
Set-ItemProperty -Path "$PathToCUAccessibility\Keyboard Response" -Name "Flags" -Value "122"
Set-ItemProperty -Path "$PathToCUAccessibility\ToggleKeys" -Name "Flags" -Value "58"
Write-Section -Text "Microsoft Edge Policies"
Write-Caption -Text "Privacy, search and services / Address bar and search"
Write-Host "[=][Personal] Show me search and site suggestions using my typed characters..."
Remove-ItemProperty -Path "$PathToCUPoliciesEdge" -Name "SearchSuggestEnabled" -Force -ErrorAction SilentlyContinue
Write-Host "[=][Personal] Show me history and favorite suggestions and other data using my typed characters..."
Remove-ItemProperty -Path "$PathToCUPoliciesEdge" -Name "LocalProvidersEnabled" -Force -ErrorAction SilentlyContinue
@ -172,6 +165,7 @@ function Register-PersonalTweaksList() {
Write-Host "[+][Personal] Setting up the DNS over HTTPS for Google and Cloudflare (ipv4 and ipv6)..."
Set-DnsClientDohServerAddress -ServerAddress ("8.8.8.8", "8.8.4.4", "2001:4860:4860::8888", "2001:4860:4860::8844") -AutoUpgrade $true -AllowFallbackToUdp $true
Set-DnsClientDohServerAddress -ServerAddress ("1.1.1.1", "1.0.0.1", "2606:4700:4700::1111", "2606:4700:4700::1001") -AutoUpgrade $true -AllowFallbackToUdp $true
Write-Host "[+][Personal] Setting up the DNS from Google (ipv4 and ipv6)..."
#Get-DnsClientServerAddress # To look up the current config. # Cloudflare, Google, Cloudflare, Google
Set-DNSClientServerAddress -InterfaceAlias "Ethernet*" -ServerAddresses ("1.1.1.1", "8.8.8.8", "2606:4700:4700::1111", "2001:4860:4860::8888")
@ -180,10 +174,6 @@ function Register-PersonalTweaksList() {
Write-Host "[+][Personal] Bringing back F8 alternative Boot Modes..."
bcdedit /set `{current`} bootmenupolicy Legacy
Write-Host "[+][Personal] Fixing Xbox Game Bar FPS Counter (LIMITED BY LANGUAGE)..."
net localgroup "Performance Log Users" "$env:USERNAME" /add # ENG
net localgroup "Usuários de log de desempenho" "$env:USERNAME" /add # PT-BR
Write-Section -Text "Power Plan Tweaks"
$TimeoutScreenBattery = 5
$TimeoutScreenPluggedIn = 10
@ -197,8 +187,9 @@ function Register-PersonalTweaksList() {
$TimeoutHibernateBattery = 15
$TimeoutHibernatePluggedIn = 30
Write-Host "[=][Personal] Setting Hibernate size to full..."
powercfg -hibernate -type full
Write-Host "[=][Personal] Setting Hibernate size to reduced..."
powercfg -hibernate -type reduced
Write-Host "[-][Personal] Disabling Hibernate..."
powercfg -hibernate off
@ -227,9 +218,8 @@ function Main() {
"[+][Personal] Enabling"
)
If (($Revert)) {
If ($Revert) {
Write-Host "[<][Personal] Reverting: $Revert."
$Zero = 1
$One = 0
$EnableStatus = @(

@ -1,16 +1,10 @@
function Request-PrivilegesElevation() {
# Used from https://stackoverflow.com/a/31602095 because it preserves the working directory!
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 }
}
function Main() {
Request-PrivilegesElevation
# The following code is from Microsoft (Adapted): https://go.microsoft.com/fwlink/?LinkId=619547
# Get all the provisioned packages
$Packages = (Get-Item 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Applications') | Get-ChildItem
# Filter the list if provided a filter
$PackageFilter = $args[0]
If ([string]::IsNullOrEmpty($PackageFilter)) {
Write-Warning "No filter specified, attempting to re-register all provisioned apps."
}
@ -30,7 +24,6 @@ function Main() {
# Get package name & path
$PackageName = $Package | Get-ItemProperty | Select-Object -ExpandProperty PSChildName
$PackagePath = [System.Environment]::ExpandEnvironmentVariables(($Package | Get-ItemProperty | Select-Object -ExpandProperty Path))
# Register the package
Write-Host "Attempting to register package: $PackageName."
Add-AppxPackage -register $PackagePath -DisableDevelopmentMode

@ -2,8 +2,6 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"remove-uwp-apps.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"show-dialog-window.psm1"
function Remove-Xbox() {
[CmdletBinding()] param()
$PathToLMPoliciesGameDVR = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR"
Write-Host "[-][Services] Disabling Xbox Services (Except from Accessories)..."

@ -1,8 +1,6 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\original\"New-FolderForced.psm1"
function Remove-OneDrive() {
[CmdletBinding()] param()
# Description: This script will remove and disable OneDrive integration.
Write-Host "Kill OneDrive process..."
taskkill.exe /F /IM "OneDrive.exe"

@ -16,7 +16,6 @@ function Use-DebloatSoftware() {
Write-Host "[+] Running ShutUp10 and applying Recommended settings..."
Start-Process -FilePath $ShutUpOutput -ArgumentList "ooshutup10.cfg", "/quiet" -Wait # Wait until the process closes #
Remove-Item "$ShutUpOutput" -Force # Leave no traces
Pop-Location
}

@ -1,5 +0,0 @@
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\{C2FBB630-2971-11D1-A18C-00C04FD75D13}]
[-HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\{C2FBB631-2971-11D1-A18C-00C04FD75D13}]

@ -5,29 +5,29 @@ echo Set oLink = oWS.CreateShortcut(sLinkFile) >> CreateShortcut.vbs
echo oLink.TargetPath = "%SYSTEMROOT%\System32\shutdown.exe" >> CreateShortcut.vbs
echo oLink.Arguments = "-s -f -t 0" >> CreateShortcut.vbs
echo oLink.IconLocation = "%SYSTEMROOT%\System32\SHELL32.dll, 27" >> CreateShortcut.vbs REM 27 or 215 is the number of icon to shutdown in SHELL32.dll
REM echo "%SYSTEMROOT%\system32\imageres.dll, 2" >> CreateShortcut.vbs REM Icons of Windows 10
REM echo "%SYSTEMROOT%\system32\pifmgr.dll, 2" >> CreateShortcut.vbs REM Icons of Windows 95/98
REM echo "%SYSTEMROOT%\explorer.exe, 2" >> CreateShortcut.vbs REM Icons of Windows Explorer
REM echo "%SYSTEMROOT%\system32\accessibilitycpl.dll, 2" >> CreateShortcut.vbs REM Icons of Accessibility
REM echo "%SYSTEMROOT%\system32\ddores.dll, 2" >> CreateShortcut.vbs REM Icons of Hardware
REM echo "%SYSTEMROOT%\system32\moricons.dll, 2" >> CreateShortcut.vbs REM Icons of MS-DOS
REM echo "%SYSTEMROOT%\system32\mmcndmgr.dll, 2" >> CreateShortcut.vbs REM More Icons of Windows 95/98
REM echo "%SYSTEMROOT%\system32\mmres.dll, 2" >> CreateShortcut.vbs REM Icons of Audio
REM echo "%SYSTEMROOT%\system32\netshell.dll, 2" >> CreateShortcut.vbs REM Icons of Network
REM echo "%SYSTEMROOT%\system32\netcenter.dll, 2" >> CreateShortcut.vbs REM More Icons of Network
REM echo "%SYSTEMROOT%\system32\networkexplorer.dll, 2" >> CreateShortcut.vbs REM More Icons of Network and Printer
REM echo "%SYSTEMROOT%\system32\pnidui.dll, 2" >> CreateShortcut.vbs REM More Icons of Status in Network
REM echo "%SYSTEMROOT%\system32\sensorscpl.dll, 2" >> CreateShortcut.vbs REM Icons of Distinct Sensors
REM echo "%SYSTEMROOT%\system32\setupapi.dll, 2" >> CreateShortcut.vbs REM Icons of Setup Wizard
REM echo "%SYSTEMROOT%\system32\wmploc.dll, 2" >> CreateShortcut.vbs REM Icons of Player
REM echo "%SYSTEMROOT%\system32\system32\wpdshext.dll, 2" >> CreateShortcut.vbs REM Icons of Portable devices and Battery
REM echo "%SYSTEMROOT%\system32\compstui.dll, 2" >> CreateShortcut.vbs REM Classic Icons of Printer, Phone and Email
REM echo "%SYSTEMROOT%\system32\dmdskres.dll, 2" >> CreateShortcut.vbs REM Icons of Disk Management
REM echo "%SYSTEMROOT%\system32\dsuiext.dll, 2" >> CreateShortcut.vbs REM Icons of Services in Network
REM echo "%SYSTEMROOT%\system32\mstscax.dll, 2" >> CreateShortcut.vbs REM Icons of Remote Connection
REM echo "%SYSTEMROOT%\system32\wiashext.dll, 2" >> CreateShortcut.vbs REM Icons of Hardware in Image
REM echo "%SYSTEMROOT%\system32\comres.dll, 2" >> CreateShortcut.vbs REM Icons of Actions
REM echo "%SYSTEMROOT%\system32\comres.dll, 2" >> CreateShortcut.vbs REM More Icons of Network, Sound and logo from Windows 8
REM "%SYSTEMROOT%\system32\imageres.dll, 2" >> CreateShortcut.vbs REM Icons of Windows 10
REM "%SYSTEMROOT%\system32\pifmgr.dll, 2" >> CreateShortcut.vbs REM Icons of Windows 95/98
REM "%SYSTEMROOT%\explorer.exe, 2" >> CreateShortcut.vbs REM Icons of Windows Explorer
REM "%SYSTEMROOT%\system32\accessibilitycpl.dll, 2" >> CreateShortcut.vbs REM Icons of Accessibility
REM "%SYSTEMROOT%\system32\ddores.dll, 2" >> CreateShortcut.vbs REM Icons of Hardware
REM "%SYSTEMROOT%\system32\moricons.dll, 2" >> CreateShortcut.vbs REM Icons of MS-DOS
REM "%SYSTEMROOT%\system32\mmcndmgr.dll, 2" >> CreateShortcut.vbs REM More Icons of Windows 95/98
REM "%SYSTEMROOT%\system32\mmres.dll, 2" >> CreateShortcut.vbs REM Icons of Audio
REM "%SYSTEMROOT%\system32\netshell.dll, 2" >> CreateShortcut.vbs REM Icons of Network
REM "%SYSTEMROOT%\system32\netcenter.dll, 2" >> CreateShortcut.vbs REM More Icons of Network
REM "%SYSTEMROOT%\system32\networkexplorer.dll, 2" >> CreateShortcut.vbs REM More Icons of Network and Printer
REM "%SYSTEMROOT%\system32\pnidui.dll, 2" >> CreateShortcut.vbs REM More Icons of Status in Network
REM "%SYSTEMROOT%\system32\sensorscpl.dll, 2" >> CreateShortcut.vbs REM Icons of Distinct Sensors
REM "%SYSTEMROOT%\system32\setupapi.dll, 2" >> CreateShortcut.vbs REM Icons of Setup Wizard
REM "%SYSTEMROOT%\system32\wmploc.dll, 2" >> CreateShortcut.vbs REM Icons of Player
REM "%SYSTEMROOT%\system32\system32\wpdshext.dll, 2" >> CreateShortcut.vbs REM Icons of Portable devices and Battery
REM "%SYSTEMROOT%\system32\compstui.dll, 2" >> CreateShortcut.vbs REM Classic Icons of Printer, Phone and Email
REM "%SYSTEMROOT%\system32\dmdskres.dll, 2" >> CreateShortcut.vbs REM Icons of Disk Management
REM "%SYSTEMROOT%\system32\dsuiext.dll, 2" >> CreateShortcut.vbs REM Icons of Services in Network
REM "%SYSTEMROOT%\system32\mstscax.dll, 2" >> CreateShortcut.vbs REM Icons of Remote Connection
REM "%SYSTEMROOT%\system32\wiashext.dll, 2" >> CreateShortcut.vbs REM Icons of Hardware in Image
REM "%SYSTEMROOT%\system32\comres.dll, 2" >> CreateShortcut.vbs REM Icons of Actions
REM "%SYSTEMROOT%\system32\comres.dll, 2" >> CreateShortcut.vbs REM More Icons of Network, Sound and logo from Windows 8
echo oLink.Save >> CreateShortcut.vbs
cscript CreateShortcut.vbs

@ -1,55 +0,0 @@
::::::::::::::::::::::::::::::::::::::::::::
:: Elevate.cmd - Version 4
:: Automatically check & get admin rights
::::::::::::::::::::::::::::::::::::::::::::
@echo off
CLS
ECHO.
ECHO =============================
ECHO Running Admin shell
ECHO =============================
:init
setlocal DisableDelayedExpansion
set cmdInvoke=1
set winSysFolder=System32
set "batchPath=%~0"
for %%k in (%0) do set batchName=%%~nk
set "vbsGetPrivileges=%temp%\OEgetPriv_%batchName%.vbs"
setlocal EnableDelayedExpansion
:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
:getPrivileges
if '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges)
ECHO.
ECHO **************************************
ECHO Invoking UAC for Privilege Escalation
ECHO **************************************
ECHO Set UAC = CreateObject^("Shell.Application"^) > "%vbsGetPrivileges%"
ECHO args = "ELEV " >> "%vbsGetPrivileges%"
ECHO For Each strArg in WScript.Arguments >> "%vbsGetPrivileges%"
ECHO args = args ^& strArg ^& " " >> "%vbsGetPrivileges%"
ECHO Next >> "%vbsGetPrivileges%"
if '%cmdInvoke%'=='1' goto InvokeCmd
ECHO UAC.ShellExecute "!batchPath!", args, "", "runas", 1 >> "%vbsGetPrivileges%"
goto ExecElevation
:InvokeCmd
ECHO args = "/c """ + "!batchPath!" + """ " + args >> "%vbsGetPrivileges%"
ECHO UAC.ShellExecute "%SystemRoot%\%winSysFolder%\cmd.exe", args, "", "runas", 1 >> "%vbsGetPrivileges%"
:ExecElevation
"%SystemRoot%\%winSysFolder%\WScript.exe" "%vbsGetPrivileges%" %*
exit /B
:gotPrivileges
setlocal & cd /d %~dp0
if '%1'=='ELEV' (del "%vbsGetPrivileges%" 1>nul 2>nul & shift /1)
REM "Your script here"

@ -1,20 +0,0 @@
function Request-PrivilegesElevation() {
# Used from https://stackoverflow.com/a/31602095 because it preserves the working directory!
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 }
}
function Main() {
Request-PrivilegesElevation
Write-Host "[-] Removing the annoying message..."
Write-Host "[-][Services] Disabling sppsvc..."
Get-Service -Name "sppsvc" -ErrorAction SilentlyContinue | Set-Service -StartupType Disabled
Stop-Service "sppsvc" -Force -NoWait
bcdedit -set TESTSIGNING OFF
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\sppsvc" -Name "Start" -Type DWord -Value 4
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows" -Name "DisplayNotRet" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "PaintDesktopVersion" -Type DWord -Value 0
}
Main

@ -2,9 +2,8 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"download-web-file.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"get-os-info.psm1"
function ArchWSLInstall() {
[CmdletBinding()] param()
$OSArchList = Get-OSArchitecture
ForEach ($OSArch in $OSArchList) {
If ($OSArch -like "x64") {
$CertOutput = Get-APIFile -URI "https://api.github.com/repos/yuk7/ArchWSL/releases/latest" -APIObjectContainer "assets" -FileNameLike "ArchWSL-AppX_*_$OSArch.cer" -APIProperty "browser_download_url" -OutputFile "ArchWSL.cer"

@ -34,8 +34,6 @@ function Initialize-GitUser() {
}
function Set-GitProfile() {
[CmdletBinding()] param()
$GitUserName = $(git config --global user.name)
$GitUserEmail = $(git config --global user.email)
$GIT_USER_PROPERTIES = @("name", "email")
@ -93,8 +91,6 @@ function Enable-SshAndGpgAgent() {
}
function Set-SSHKey() {
[CmdletBinding()] param()
$SSHPath = "~\.ssh"
$SSHEncryptionType = "ed25519"
$SSHDefaultFileName = "id_$SSHEncryptionType"
@ -133,10 +129,10 @@ function Set-GPGKey() {
Write-Host "Creating folder on '$GnuPGPath'"
mkdir "$GnuPGPath" | Out-Null
}
Push-Location "$GnuPGPath"
Write-Host "Generating new GPG key in $GnuPGPath/$GnuPGFileName..."
Write-Host "Before exporting your public and private keys, add manually an email." -ForegroundColor Cyan
Write-Host "Type: 1 (RSA and RSA) [ENTER]." -ForegroundColor Cyan
Write-Host "Type: 4096 [ENTER]." -ForegroundColor Cyan
@ -150,9 +146,9 @@ function Set-GPGKey() {
Write-Host "Then: [your passphrase again] [ENTER]." -ForegroundColor Cyan
gpg --full-generate-key
Write-Verbose "If you want to delete unwanted keys, this is just for reference"
Write-Verbose 'gpg --delete-secret-keys $(git config --global user.name)'
Write-Verbose 'gpg --delete-keys $(git config --global user.name)'
Write-Host "[@] If you want to delete unwanted keys, this is just for reference" -ForegroundColor White
Write-Host '[@] gpg --delete-secret-keys $(git config --global user.name)' -ForegroundColor White
Write-Host '[@] gpg --delete-keys $(git config --global user.name)' -ForegroundColor White
Write-Host "Copying all files to $GnuPGPath"
Copy-Item -Path "$GnuPGGeneratePath/*" -Destination "$GnuPGPath/" -Recurse

@ -2,9 +2,8 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"download-web-file.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"get-os-info.psm1"
function WSLwithGraphicsInstall() {
[CmdletBinding()] param()
$OSArchList = Get-OSArchitecture
If ([System.Environment]::OSVersion.Version.Build -eq 14393) {
# 1607 needs developer mode to be enabled for older Windows 10 versions
Write-Host "[+] Enabling Development mode w/out license and trusted apps (Win 10 1607)"

Loading…
Cancel
Save