Add 2 libs to manage registry item creation/removal

- By using this there's no need anymore to use the New-FolderForced.psm1
- This finishes total integration with all scripts that create a new item property verifying its existence before
- Using these new functions "override" native ones, and remove the need to Test-Path as it verifies before adding or removing an entry
main
Plínio Larrubia 2 years ago committed by Plínio Larrubia
parent 3005e5440d
commit 79886d57f3
No known key found for this signature in database
GPG Key ID: 057B0A87CB137C69

@ -0,0 +1,44 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\"title-templates.psm1"
function Remove-ItemVerified() {
[CmdletBinding()]
param (
[Parameter(Position = 0, Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[String] $Path,
[Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)]
[String[]] $Include,
[Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)]
[String[]] $Exclude,
[Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)]
[Switch] $Recurse,
[Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)]
[Switch] $Force
)
Begin {
$Script:TweakType = "Exp/Reg"
}
Process {
If (Test-Path "$Path") {
Write-Status -Types "-", $TweakType -Status "Removing: '$Path'"
If ($Recurse -and $Force) {
Remove-Item -Path "$Path" -Include $Include -Exclude $Exclude -Recurse -Force
Continue
}
If ($Recurse) {
Remove-Item -Path "$Path" -Include $Include -Exclude $Exclude -Recurse
} ElseIf ($Force) {
Remove-Item -Path "$Path" -Include $Include -Exclude $Exclude -Force
} Else {
Remove-Item -Path "$Path" -Include $Include -Exclude $Exclude
}
} Else {
Write-Status -Types "?", $TweakType -Status "The path $Path does not exist" -Warning
}
}
End {
}
}

@ -0,0 +1,36 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\"title-templates.psm1"
function Set-ItemPropertyVerified() {
[CmdletBinding()]
param (
[Parameter(Position = 0, Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[String] $Path,
[Parameter(Position = 1, Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[String] $Name,
[Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)]
[ValidateSet('Binary', 'DWord', 'ExpandString', 'MultiString', 'Qword', 'String', 'Unknown')]
[String] $Type,
[Parameter(Position = 2, Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
$Value <# Will have dynamic typing #>
)
Begin {
$Script:TweakType = "Registry"
}
Process {
If (!(Test-Path "$Path")) {
Write-Status -Types "?", $TweakType -Status "Creating new path in '$Path'..." -Warning
New-Item -Path "$Path" -Force | Out-Null
}
If ($Type) {
Set-ItemProperty -Path "$Path" -Name "$Name" -Type $Type -Value $Value
} Else {
Set-ItemProperty -Path "$Path" -Name "$Name" -Value $Value
}
}
End {
}
}

@ -1,39 +0,0 @@
<#
.SYNOPSIS
If the target registry key is already present, all values within that key are purged.
.DESCRIPTION
While `mkdir -force` works fine when dealing with regular folders, it behaves strange when using it at registry level.
If the target registry key is already present, all values within that key are purged.
.PARAMETER Path
Full path of the storage or registry folder
.EXAMPLE
New-FolderForced -Path "HKCU:\Printers\Defaults"
.EXAMPLE
New-FolderForced "HKCU:\Printers\Defaults"
.EXAMPLE
"HKCU:\Printers\Defaults" | New-FolderForced
.NOTES
Replacement for `force-mkdir` to uphold PowerShell conventions.
Thanks to raydric, this function should be used instead of `mkdir -force`.
#>
function New-FolderForced {
[CmdletBinding(SupportsShouldProcess = $true)]
param (
[Parameter(Position = 0, Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[string]
$Path
)
Process {
If (-not (Test-Path $Path)) {
Write-Verbose "-- Creating full path to: $Path"
New-Item -Path $Path -ItemType Directory -Force
}
}
}

@ -1,6 +1,7 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"open-file.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"open-file.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"unregister-duplicated-power-plans.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"unregister-duplicated-power-plans.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"set-item-property-verified.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\utils\"individual-tweaks.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\utils\"individual-tweaks.psm1"
# Adapted from: https://youtu.be/hQSkPmZRCjc # Adapted from: https://youtu.be/hQSkPmZRCjc
@ -45,20 +46,20 @@ function Optimize-Performance() {
Write-Section -Text "System" Write-Section -Text "System"
Write-Caption -Text "Display" Write-Caption -Text "Display"
Write-Status -Types "+", $TweakType -Status "Enable Hardware Accelerated GPU Scheduling... (Windows 10 20H1+ - Needs Restart)" Write-Status -Types "+", $TweakType -Status "Enable Hardware Accelerated GPU Scheduling... (Windows 10 20H1+ - Needs Restart)"
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name "HwSchMode" -Type DWord -Value 2 Set-ItemPropertyVerified -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name "HwSchMode" -Type DWord -Value 2
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Remote Assistance..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Remote Assistance..."
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value $Zero
Write-Status -Types "-", $TweakType -Status "Disabling Ndu High RAM Usage..." Write-Status -Types "-", $TweakType -Status "Disabling Ndu High RAM Usage..."
# [@] (2 = Enable Ndu, 4 = Disable Ndu) # [@] (2 = Enable Ndu, 4 = Disable Ndu)
Set-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Services\Ndu" -Name "Start" -Type DWord -Value 4 Set-ItemPropertyVerified -Path "HKLM:\SYSTEM\ControlSet001\Services\Ndu" -Name "Start" -Type DWord -Value 4
# Details: https://www.tenforums.com/tutorials/94628-change-split-threshold-svchost-exe-windows-10-a.html # Details: https://www.tenforums.com/tutorials/94628-change-split-threshold-svchost-exe-windows-10-a.html
# Will reduce Processes number considerably on > 4GB of RAM systems # Will reduce Processes number considerably on > 4GB of RAM systems
Write-Status -Types "+", $TweakType -Status "Setting SVCHost to match installed RAM size..." Write-Status -Types "+", $TweakType -Status "Setting SVCHost to match installed RAM size..."
$RamInKB = (Get-CimInstance -ClassName Win32_PhysicalMemory | Measure-Object -Property Capacity -Sum).Sum / 1KB $RamInKB = (Get-CimInstance -ClassName Win32_PhysicalMemory | Measure-Object -Property Capacity -Sum).Sum / 1KB
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control" -Name "SvcHostSplitThresholdInKB" -Type DWord -Value $RamInKB Set-ItemPropertyVerified -Path "HKLM:\SYSTEM\CurrentControlSet\Control" -Name "SvcHostSplitThresholdInKB" -Type DWord -Value $RamInKB
Write-Status -Types "*", $TweakType -Status "Enabling Windows Store apps Automatic Updates..." Write-Status -Types "*", $TweakType -Status "Enabling Windows Store apps Automatic Updates..."
If (!(Test-Path "$PathToLMPoliciesWindowsStore")) { If (!(Test-Path "$PathToLMPoliciesWindowsStore")) {
@ -86,20 +87,17 @@ function Optimize-Performance() {
Write-Section -Text "Network & Internet" Write-Section -Text "Network & Internet"
Write-Status -Types "+", $TweakType -Status "Unlimiting your network bandwidth for all your system..." # Based on this Chris Titus video: https://youtu.be/7u1miYJmJ_4 Write-Status -Types "+", $TweakType -Status "Unlimiting your network bandwidth for all your system..." # Based on this Chris Titus video: https://youtu.be/7u1miYJmJ_4
If (!(Test-Path "$PathToLMPoliciesPsched")) { Set-ItemPropertyVerified -Path "$PathToLMPoliciesPsched" -Name "NonBestEffortLimit" -Type DWord -Value 0
New-Item -Path "$PathToLMPoliciesPsched" -Force | Out-Null Set-ItemPropertyVerified -Path "$PathToLMMultimediaSystemProfile" -Name "NetworkThrottlingIndex" -Type DWord -Value 0xffffffff
}
Set-ItemProperty -Path "$PathToLMPoliciesPsched" -Name "NonBestEffortLimit" -Type DWord -Value 0
Set-ItemProperty -Path "$PathToLMMultimediaSystemProfile" -Name "NetworkThrottlingIndex" -Type DWord -Value 0xffffffff
Write-Section -Text "System & Apps Timeout behaviors" Write-Section -Text "System & Apps Timeout behaviors"
Write-Status -Types "+", $TweakType -Status "Reducing Time to services app timeout to 2s to ALL users..." Write-Status -Types "+", $TweakType -Status "Reducing Time to services app timeout to 2s to ALL users..."
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control" -Name "WaitToKillServiceTimeout" -Type DWord -Value 2000 # Default: 20000 / 5000 Set-ItemPropertyVerified -Path "HKLM:\SYSTEM\CurrentControlSet\Control" -Name "WaitToKillServiceTimeout" -Type DWord -Value 2000 # Default: 20000 / 5000
Write-Status -Types "*", $TweakType -Status "Don't clear page file at shutdown (takes more time) to ALL users..." Write-Status -Types "*", $TweakType -Status "Don't clear page file at shutdown (takes more time) to ALL users..."
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" -Name "ClearPageFileAtShutdown" -Type DWord -Value 0 # Default: 0 Set-ItemPropertyVerified -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" -Name "ClearPageFileAtShutdown" -Type DWord -Value 0 # Default: 0
Write-Status -Types "+", $TweakType -Status "Reducing mouse hover time events to 10ms..." Write-Status -Types "+", $TweakType -Status "Reducing mouse hover time events to 10ms..."
Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseHoverTime" -Type String -Value "1000" # Default: 400 Set-ItemPropertyVerified -Path "HKCU:\Control Panel\Mouse" -Name "MouseHoverTime" -Type String -Value "1000" # Default: 400
# Details: https://windowsreport.com/how-to-speed-up-windows-11-animations/ and https://www.tenforums.com/tutorials/97842-change-hungapptimeout-value-windows-10-a.html # Details: https://windowsreport.com/how-to-speed-up-windows-11-animations/ and https://www.tenforums.com/tutorials/97842-change-hungapptimeout-value-windows-10-a.html
ForEach ($DesktopRegistryPath in @($PathToUsersControlPanelDesktop, $PathToCUControlPanelDesktop)) { ForEach ($DesktopRegistryPath in @($PathToUsersControlPanelDesktop, $PathToCUControlPanelDesktop)) {
@ -111,7 +109,7 @@ function Optimize-Performance() {
} }
Write-Status -Types "+", $TweakType -Status "Don't prompt user to end tasks on shutdown..." Write-Status -Types "+", $TweakType -Status "Don't prompt user to end tasks on shutdown..."
Set-ItemProperty -Path "$DesktopRegistryPath" -Name "AutoEndTasks" -Type DWord -Value 1 # Default: Removed or 0 Set-ItemPropertyVerified -Path "$DesktopRegistryPath" -Name "AutoEndTasks" -Type DWord -Value 1 # Default: Removed or 0
Write-Status -Types "*", $TweakType -Status "Returning 'Hung App Timeout' to default..." Write-Status -Types "*", $TweakType -Status "Returning 'Hung App Timeout' to default..."
If ((Get-Item "$DesktopRegistryPath").Property -contains "HungAppTimeout") { If ((Get-Item "$DesktopRegistryPath").Property -contains "HungAppTimeout") {
@ -119,11 +117,11 @@ function Optimize-Performance() {
} }
Write-Status -Types "+", $TweakType -Status "Reducing mouse and keyboard hooks timeout to 1s..." Write-Status -Types "+", $TweakType -Status "Reducing mouse and keyboard hooks timeout to 1s..."
Set-ItemProperty -Path "$DesktopRegistryPath" -Name "LowLevelHooksTimeout" -Type DWord -Value 1000 # Default: Removed or 5000 Set-ItemPropertyVerified -Path "$DesktopRegistryPath" -Name "LowLevelHooksTimeout" -Type DWord -Value 1000 # Default: Removed or 5000
Write-Status -Types "+", $TweakType -Status "Reducing animation speed delay to 1ms on Windows 11..." Write-Status -Types "+", $TweakType -Status "Reducing animation speed delay to 1ms on Windows 11..."
Set-ItemProperty -Path "$DesktopRegistryPath" -Name "MenuShowDelay" -Type DWord -Value 1 # Default: 400 Set-ItemPropertyVerified -Path "$DesktopRegistryPath" -Name "MenuShowDelay" -Type DWord -Value 1 # Default: 400
Write-Status -Types "+", $TweakType -Status "Reducing Time to kill apps timeout to 5s..." Write-Status -Types "+", $TweakType -Status "Reducing Time to kill apps timeout to 5s..."
Set-ItemProperty -Path "$DesktopRegistryPath" -Name "WaitToKillAppTimeout" -Type DWord -Value 5000 # Default: 20000 Set-ItemPropertyVerified -Path "$DesktopRegistryPath" -Name "WaitToKillAppTimeout" -Type DWord -Value 5000 # Default: 20000
} }
Write-Section -Text "Gaming Responsiveness Tweaks" Write-Section -Text "Gaming Responsiveness Tweaks"
@ -135,16 +133,16 @@ function Optimize-Performance() {
} }
Write-Status -Types "*", $TweakType -Status "Enabling game mode..." Write-Status -Types "*", $TweakType -Status "Enabling game mode..."
Set-ItemProperty -Path "$PathToCUGameBar" -Name "AllowAutoGameMode" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "$PathToCUGameBar" -Name "AllowAutoGameMode" -Type DWord -Value 1
Set-ItemProperty -Path "$PathToCUGameBar" -Name "AutoGameModeEnabled" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "$PathToCUGameBar" -Name "AutoGameModeEnabled" -Type DWord -Value 1
# Details: https://www.reddit.com/r/killerinstinct/comments/4fcdhy/an_excellent_guide_to_optimizing_your_windows_10/ # Details: https://www.reddit.com/r/killerinstinct/comments/4fcdhy/an_excellent_guide_to_optimizing_your_windows_10/
Write-Status -Types "+", $TweakType -Status "Reserving 100% of CPU to Multimedia/Gaming tasks..." Write-Status -Types "+", $TweakType -Status "Reserving 100% of CPU to Multimedia/Gaming tasks..."
Set-ItemProperty -Path "$PathToLMMultimediaSystemProfile" -Name "SystemResponsiveness" -Type DWord -Value 0 # Default: 20 Set-ItemPropertyVerified -Path "$PathToLMMultimediaSystemProfile" -Name "SystemResponsiveness" -Type DWord -Value 0 # Default: 20
Write-Status -Types "+", $TweakType -Status "Dedicate more CPU/GPU usage to Gaming tasks..." Write-Status -Types "+", $TweakType -Status "Dedicate more CPU/GPU usage to Gaming tasks..."
Set-ItemProperty -Path "$PathToLMMultimediaSystemProfileOnGameTasks" -Name "GPU Priority" -Type DWord -Value 8 # Default: 8 Set-ItemPropertyVerified -Path "$PathToLMMultimediaSystemProfileOnGameTasks" -Name "GPU Priority" -Type DWord -Value 8 # Default: 8
Set-ItemProperty -Path "$PathToLMMultimediaSystemProfileOnGameTasks" -Name "Priority" -Type DWord -Value 6 # Default: 2 Set-ItemPropertyVerified -Path "$PathToLMMultimediaSystemProfileOnGameTasks" -Name "Priority" -Type DWord -Value 6 # Default: 2
Set-ItemProperty -Path "$PathToLMMultimediaSystemProfileOnGameTasks" -Name "Scheduling Category" -Type String -Value "High" # Default: "Medium" Set-ItemPropertyVerified -Path "$PathToLMMultimediaSystemProfileOnGameTasks" -Name "Scheduling Category" -Type String -Value "High" # Default: "Medium"
} }
function Main() { function Main() {

@ -1,4 +1,6 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"remove-item-verified.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"set-item-property-verified.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\utils\"individual-tweaks.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\utils\"individual-tweaks.psm1"
# Adapted from: https://youtu.be/qWESrvP_uU8 # Adapted from: https://youtu.be/qWESrvP_uU8
@ -58,7 +60,7 @@ function Optimize-Privacy() {
} }
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) File Explorer Ads (OneDrive, New Features etc.)..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) File Explorer Ads (OneDrive, New Features etc.)..."
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "ShowSyncProviderNotifications" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "$PathToCUExplorerAdvanced" -Name "ShowSyncProviderNotifications" -Type DWord -Value $Zero
Write-Section -Text "Personalization" Write-Section -Text "Personalization"
Write-Caption -Text "Start & Lockscreen" Write-Caption -Text "Start & Lockscreen"
@ -92,30 +94,23 @@ function Optimize-Privacy() {
Write-Status -Types "?", $TweakType -Status "From Path: $PathToCUContentDeliveryManager" -Warning Write-Status -Types "?", $TweakType -Status "From Path: $PathToCUContentDeliveryManager" -Warning
ForEach ($Name in $ContentDeliveryManagerDisableOnZero) { ForEach ($Name in $ContentDeliveryManagerDisableOnZero) {
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) $($Name): $Zero" Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) $($Name): $Zero"
Set-ItemProperty -Path "$PathToCUContentDeliveryManager" -Name "$Name" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "$PathToCUContentDeliveryManager" -Name "$Name" -Type DWord -Value $Zero
} }
Write-Status -Types "-", $TweakType -Status "Disabling 'Suggested Content in the Settings App'..." Write-Status -Types "-", $TweakType -Status "Disabling 'Suggested Content in the Settings App'..."
If (Test-Path "$PathToCUContentDeliveryManager\Subscriptions") { Remove-ItemVerified -Path "$PathToCUContentDeliveryManager\Subscriptions" -Recurse
Remove-Item -Path "$PathToCUContentDeliveryManager\Subscriptions" -Recurse
}
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) 'Show Suggestions' in Start..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) 'Show Suggestions' in Start..."
If (Test-Path "$PathToCUContentDeliveryManager\SuggestedApps") { Remove-ItemVerified -Path "$PathToCUContentDeliveryManager\SuggestedApps" -Recurse
Remove-Item -Path "$PathToCUContentDeliveryManager\SuggestedApps" -Recurse
}
Write-Section -Text "Privacy -> Windows Permissions" Write-Section -Text "Privacy -> Windows Permissions"
Write-Caption -Text "General" Write-Caption -Text "General"
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Let apps use my advertising ID..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Let apps use my advertising ID..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled" -Type DWord -Value $Zero
If (!(Test-Path "$PathToLMPoliciesAdvertisingInfo")) { Set-ItemPropertyVerified -Path "$PathToLMPoliciesAdvertisingInfo" -Name "DisabledByGroupPolicy" -Type DWord -Value $One
New-Item -Path "$PathToLMPoliciesAdvertisingInfo" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMPoliciesAdvertisingInfo" -Name "DisabledByGroupPolicy" -Type DWord -Value $One
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) 'Let websites provide locally relevant content by accessing my language list'..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) 'Let websites provide locally relevant content by accessing my language list'..."
Set-ItemProperty -Path "HKCU:\Control Panel\International\User Profile" -Name "HttpAcceptLanguageOptOut" -Type DWord -Value $One Set-ItemPropertyVerified -Path "HKCU:\Control Panel\International\User Profile" -Name "HttpAcceptLanguageOptOut" -Type DWord -Value $One
Write-Caption -Text "Speech" Write-Caption -Text "Speech"
If (!$Revert) { If (!$Revert) {
@ -125,10 +120,10 @@ function Optimize-Privacy() {
} }
Write-Caption -Text "Inking & Typing Personalization" Write-Caption -Text "Inking & Typing Personalization"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value $Zero
Set-ItemProperty -Path "$PathToCUInputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "$PathToCUInputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value $Zero
Set-ItemProperty -Path "$PathToCUInputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value $One Set-ItemPropertyVerified -Path "$PathToCUInputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value $One
Set-ItemProperty -Path "$PathToCUInputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value $One Set-ItemPropertyVerified -Path "$PathToCUInputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value $One
Write-Caption -Text "Diagnostics & Feedback" Write-Caption -Text "Diagnostics & Feedback"
If (!$Revert) { If (!$Revert) {
@ -138,28 +133,19 @@ function Optimize-Privacy() {
} }
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) send inking and typing data to Microsoft..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) send inking and typing data to Microsoft..."
If (!(Test-Path "$PathToCUInputTIPC")) { Set-ItemPropertyVerified -Path "$PathToCUInputTIPC" -Name "Enabled" -Type DWord -Value $Zero
New-Item -Path "$PathToCUInputTIPC" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToCUInputTIPC" -Name "Enabled" -Type DWord -Value $Zero
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Improve Inking & Typing Recognition..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Improve Inking & Typing Recognition..."
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\TextInput")) { Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\TextInput" -Name "AllowLinguisticDataCollection" -Type DWord -Value $Zero
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\TextInput" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\TextInput" -Name "AllowLinguisticDataCollection" -Type DWord -Value $Zero
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) View diagnostic data..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) View diagnostic data..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack\EventTranscriptKey" -Name "EnableEventTranscript" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack\EventTranscriptKey" -Name "EnableEventTranscript" -Type DWord -Value $Zero
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) feedback frequency..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) feedback frequency..."
If (!(Test-Path "$PathToCUSiufRules")) {
New-Item -Path "$PathToCUSiufRules" -Force | Out-Null
}
If ((Test-Path "$PathToCUSiufRules\PeriodInNanoSeconds")) { If ((Test-Path "$PathToCUSiufRules\PeriodInNanoSeconds")) {
Remove-ItemProperty -Path "$PathToCUSiufRules" -Name "PeriodInNanoSeconds" Remove-ItemProperty -Path "$PathToCUSiufRules" -Name "PeriodInNanoSeconds"
} }
Set-ItemProperty -Path "$PathToCUSiufRules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "$PathToCUSiufRules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value $Zero
Write-Caption -Text "Activity History" Write-Caption -Text "Activity History"
If ($Revert) { If ($Revert) {
@ -170,35 +156,32 @@ function Optimize-Privacy() {
Write-Section -Text "Privacy -> Apps Permissions" Write-Section -Text "Privacy -> Apps Permissions"
Write-Caption -Text "Location" Write-Caption -Text "Location"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Value "Deny" Set-ItemPropertyVerified -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-ItemPropertyVerified -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-ItemPropertyVerified -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 Set-ItemPropertyVerified -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "EnableStatus" -Type DWord -Value $Zero
Write-Caption -Text "Notifications" Write-Caption -Text "Notifications"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userNotificationListener" -Name "Value" -Value "Deny" Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userNotificationListener" -Name "Value" -Value "Deny"
Write-Caption -Text "App Diagnostics" Write-Caption -Text "App Diagnostics"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics" -Name "Value" -Value "Deny" Set-ItemPropertyVerified -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" Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics" -Name "Value" -Value "Deny"
Write-Caption -Text "Account Info Access" Write-Caption -Text "Account Info Access"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userAccountInformation" -Name "Value" -Value "Deny" Set-ItemPropertyVerified -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" Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userAccountInformation" -Name "Value" -Value "Deny"
Write-Caption -Text "Other Devices" Write-Caption -Text "Other Devices"
Write-Status -Types "-", $TweakType -Status "Denying device access..." Write-Status -Types "-", $TweakType -Status "Denying device access..."
If (!(Test-Path "$PathToCUDeviceAccessGlobal\LooselyCoupled")) {
New-Item -Path "$PathToCUDeviceAccessGlobal\LooselyCoupled" -Force | Out-Null
}
# Disable sharing information with unpaired devices # Disable sharing information with unpaired devices
Set-ItemProperty -Path "$PathToCUDeviceAccessGlobal\LooselyCoupled" -Name "Value" -Value "Deny" Set-ItemPropertyVerified -Path "$PathToCUDeviceAccessGlobal\LooselyCoupled" -Name "Value" -Value "Deny"
ForEach ($key in (Get-ChildItem "$PathToCUDeviceAccessGlobal")) { ForEach ($key in (Get-ChildItem "$PathToCUDeviceAccessGlobal")) {
If ($key.PSChildName -EQ "LooselyCoupled") { If ($key.PSChildName -EQ "LooselyCoupled") {
Continue Continue
} }
Write-Status -Types $EnableStatus[1].Symbol, $TweakType -Status "$($EnableStatus[1].Status) Setting $($key.PSChildName) value to 'Deny' ..." Write-Status -Types $EnableStatus[1].Symbol, $TweakType -Status "$($EnableStatus[1].Status) Setting $($key.PSChildName) value to 'Deny' ..."
Set-ItemProperty -Path ("$PathToCUDeviceAccessGlobal\" + $key.PSChildName) -Name "Value" -Value "Deny" Set-ItemPropertyVerified -Path ("$PathToCUDeviceAccessGlobal\" + $key.PSChildName) -Name "Value" -Value "Deny"
} }
Write-Caption -Text "Background Apps" Write-Caption -Text "Background Apps"
@ -210,91 +193,69 @@ function Optimize-Privacy() {
Write-Status -Types "*", $TweakType -Status "Enabling Automatic Updates..." Write-Status -Types "*", $TweakType -Status "Enabling Automatic Updates..."
# [@] (0 = Enable Automatic Updates, 1 = Disable Automatic Updates) # [@] (0 = Enable Automatic Updates, 1 = Disable Automatic Updates)
Set-ItemProperty -Path "$PathToLMPoliciesWindowsUpdate" -Name "NoAutoUpdate" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "$PathToLMPoliciesWindowsUpdate" -Name "NoAutoUpdate" -Type DWord -Value 0
Write-Status -Types "+", $TweakType -Status "Setting Scheduled Day to Every day..." Write-Status -Types "+", $TweakType -Status "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)) # [@] (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 Set-ItemPropertyVerified -Path "$PathToLMPoliciesWindowsUpdate" -Name "ScheduledInstallDay" -Type DWord -Value 0
Write-Status -Types "-", $TweakType -Status "Setting Scheduled time to 03h00m..." Write-Status -Types "-", $TweakType -Status "Setting Scheduled time to 03h00m..."
# [@] (0-23 = The time of day in 24-hour format) # [@] (0-23 = The time of day in 24-hour format)
Set-ItemProperty -Path "$PathToLMPoliciesWindowsUpdate" -Name "ScheduledInstallTime" -Type DWord -Value 3 Set-ItemPropertyVerified -Path "$PathToLMPoliciesWindowsUpdate" -Name "ScheduledInstallTime" -Type DWord -Value 3
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Automatic Reboot after update..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Automatic Reboot after update..."
# [@] (0 = Enable Automatic Reboot after update, 1 = Disable Automatic Reboot after update) # [@] (0 = Enable Automatic Reboot after update, 1 = Disable Automatic Reboot after update)
Set-ItemProperty -Path "$PathToLMPoliciesWindowsUpdate" -Name "NoAutoRebootWithLoggedOnUsers" -Type DWord -Value $One Set-ItemPropertyVerified -Path "$PathToLMPoliciesWindowsUpdate" -Name "NoAutoRebootWithLoggedOnUsers" -Type DWord -Value $One
Write-Status -Types $EnableStatus[1].Symbol, $TweakType -Status "$($EnableStatus[1].Status) Change Windows Updates to 'Notify to schedule restart'..." Write-Status -Types $EnableStatus[1].Symbol, $TweakType -Status "$($EnableStatus[1].Status) Change Windows Updates to 'Notify to schedule restart'..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value $One Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value $One
Write-Status -Types $EnableStatus[1].Symbol, $TweakType -Status "$($EnableStatus[1].Status) Restricting Windows Update P2P downloads for Local Network only..." Write-Status -Types $EnableStatus[1].Symbol, $TweakType -Status "$($EnableStatus[1].Status) 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) # [@] (0 = Off, 1 = Local Network only, 2 = Local Network private peering only)
# [@] (3 = Local Network and Internet, 99 = Simply Download mode, 100 = Bypass mode) # [@] (3 = Local Network and Internet, 99 = Simply Download mode, 100 = Bypass mode)
Set-ItemProperty -Path "$PathToLMDeliveryOptimizationCfg" -Name "DODownloadMode" -Type DWord -Value $One Set-ItemPropertyVerified -Path "$PathToLMDeliveryOptimizationCfg" -Name "DODownloadMode" -Type DWord -Value $One
Write-Caption -Text "Troubleshooting" Write-Caption -Text "Troubleshooting"
Write-Status -Types "+", $TweakType -Status "Enabling Automatic Recommended Troubleshooting, then notify me..." Write-Status -Types "+", $TweakType -Status "Enabling Automatic Recommended Troubleshooting, then notify me..."
If (!(Test-Path "$PathToLMWindowsTroubleshoot")) { Set-ItemPropertyVerified -Path "$PathToLMWindowsTroubleshoot" -Name "UserPreference" -Type DWord -Value 3
New-Item -Path "$PathToLMWindowsTroubleshoot" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMWindowsTroubleshoot" -Name "UserPreference" -Type DWord -Value 3
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Windows Spotlight Features..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Windows Spotlight Features..."
If (!(Test-Path "$PathToCUPoliciesCloudContent")) { Set-ItemPropertyVerified -Path "$PathToCUPoliciesCloudContent" -Name "ConfigureWindowsSpotlight" -Type DWord -Value 2
New-Item -Path "$PathToCUPoliciesCloudContent" -Force | Out-Null Set-ItemPropertyVerified -Path "$PathToCUPoliciesCloudContent" -Name "IncludeEnterpriseSpotlight" -Type DWord -Value $Zero
} Set-ItemPropertyVerified -Path "$PathToCUPoliciesCloudContent" -Name "DisableWindowsSpotlightFeatures" -Type DWord -Value $One
Set-ItemProperty -Path "$PathToCUPoliciesCloudContent" -Name "ConfigureWindowsSpotlight" -Type DWord -Value 2 Set-ItemPropertyVerified -Path "$PathToCUPoliciesCloudContent" -Name "DisableWindowsSpotlightOnActionCenter" -Type DWord -Value $One
Set-ItemProperty -Path "$PathToCUPoliciesCloudContent" -Name "IncludeEnterpriseSpotlight" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "$PathToCUPoliciesCloudContent" -Name "DisableWindowsSpotlightOnSettings" -Type DWord -Value $One
Set-ItemProperty -Path "$PathToCUPoliciesCloudContent" -Name "DisableWindowsSpotlightFeatures" -Type DWord -Value $One Set-ItemPropertyVerified -Path "$PathToCUPoliciesCloudContent" -Name "DisableWindowsSpotlightWindowsWelcomeExperience" -Type DWord -Value $One
Set-ItemProperty -Path "$PathToCUPoliciesCloudContent" -Name "DisableWindowsSpotlightOnActionCenter" -Type DWord -Value $One
Set-ItemProperty -Path "$PathToCUPoliciesCloudContent" -Name "DisableWindowsSpotlightOnSettings" -Type DWord -Value $One
Set-ItemProperty -Path "$PathToCUPoliciesCloudContent" -Name "DisableWindowsSpotlightWindowsWelcomeExperience" -Type DWord -Value $One
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Tailored Experiences..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Tailored Experiences..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy" -Name "TailoredExperiencesWithDiagnosticDataEnabled" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy" -Name "TailoredExperiencesWithDiagnosticDataEnabled" -Type DWord -Value $Zero
Set-ItemProperty -Path "$PathToCUPoliciesCloudContent" -Name "DisableTailoredExperiencesWithDiagnosticData" -Type DWord -Value $One Set-ItemPropertyVerified -Path "$PathToCUPoliciesCloudContent" -Name "DisableTailoredExperiencesWithDiagnosticData" -Type DWord -Value $One
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Third Party Suggestions..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Third Party Suggestions..."
Set-ItemProperty -Path "$PathToCUPoliciesCloudContent" -Name "DisableThirdPartySuggestions" -Type DWord -Value $One Set-ItemPropertyVerified -Path "$PathToCUPoliciesCloudContent" -Name "DisableThirdPartySuggestions" -Type DWord -Value $One
Set-ItemProperty -Path "$PathToCUPoliciesCloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value $One Set-ItemPropertyVerified -Path "$PathToCUPoliciesCloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value $One
# Reference (the path may differ, but the description matches): https://admx.help/?Category=Windows_11_2022&Policy=Microsoft.Policies.DeviceSoftwareSetup::DriverSearchPlaces_SearchOrderConfiguration # Reference (the path may differ, but the description matches): https://admx.help/?Category=Windows_11_2022&Policy=Microsoft.Policies.DeviceSoftwareSetup::DriverSearchPlaces_SearchOrderConfiguration
Write-Status -Types "+", $TweakType -Status "Enabling Windows Update to search Drivers..." Write-Status -Types "+", $TweakType -Status "Enabling Windows Update to search Drivers..."
# [@] (0 = Do not search Windows Update, 1 = Always search Windows Update, 2 = Search Windows Update only if needed) # [@] (0 = Do not search Windows Update, 1 = Always search Windows Update, 2 = Search Windows Update only if needed)
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching" -Name "SearchOrderConfig" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching" -Name "SearchOrderConfig" -Type DWord -Value 1
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) enhanced icons and manufacturer apps (escape from broken drivers and bloatware)..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) enhanced icons and manufacturer apps (escape from broken drivers and bloatware)..."
# [@] (0 = Enhanced icons enabled, 1 = Enhanced icons disabled) # [@] (0 = Enhanced icons enabled, 1 = Enhanced icons disabled)
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -Type DWord -Value $One Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -Type DWord -Value $One
Set-ItemPropertyVerified -Path "$PathToLMPoliciesSQMClient" -Name "CEIPEnable" -Type DWord -Value $Zero
If (!(Test-Path "$PathToLMPoliciesSQMClient")) { Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat" -Name "AITEnable" -Type DWord -Value $Zero
New-Item -Path "$PathToLMPoliciesSQMClient" -Force | Out-Null Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat" -Name "DisableUAR" -Type DWord -Value $One
}
Set-ItemProperty -Path "$PathToLMPoliciesSQMClient" -Name "CEIPEnable" -Type DWord -Value $Zero
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat" -Name "AITEnable" -Type DWord -Value $Zero
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat" -Name "DisableUAR" -Type DWord -Value $One
# Details: https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/rds-vdi-recommendations-2004#windows-system-startup-event-traces-autologgers # Details: https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/rds-vdi-recommendations-2004#windows-system-startup-event-traces-autologgers
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) some startup event traces (AutoLoggers)..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) some startup event traces (AutoLoggers)..."
If (!(Test-Path "$PathToLMAutoLogger\AutoLogger-Diagtrack-Listener")) { Set-ItemPropertyVerified -Path "$PathToLMAutoLogger\AutoLogger-Diagtrack-Listener" -Name "Start" -Type DWord -Value $Zero
New-Item -Path "$PathToLMAutoLogger\AutoLogger-Diagtrack-Listener" -Force | Out-Null Set-ItemPropertyVerified -Path "$PathToLMAutoLogger\SQMLogger" -Name "Start" -Type DWord -Value $Zero
}
Set-ItemProperty -Path "$PathToLMAutoLogger\AutoLogger-Diagtrack-Listener" -Name "Start" -Type DWord -Value $Zero
Set-ItemProperty -Path "$PathToLMAutoLogger\SQMLogger" -Name "Start" -Type DWord -Value $Zero
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) 'WiFi Sense: HotSpot Sharing'..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) 'WiFi Sense: HotSpot Sharing'..."
If (!(Test-Path "$PathToLMPoliciesToWifi\AllowWiFiHotSpotReporting")) { Set-ItemPropertyVerified -Path "$PathToLMPoliciesToWifi\AllowWiFiHotSpotReporting" -Name "value" -Type DWord -Value $Zero
New-Item -Path "$PathToLMPoliciesToWifi\AllowWiFiHotSpotReporting" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMPoliciesToWifi\AllowWiFiHotSpotReporting" -Name "value" -Type DWord -Value $Zero
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) 'WiFi Sense: Shared HotSpot Auto-Connect'..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) 'WiFi Sense: Shared HotSpot Auto-Connect'..."
If (!(Test-Path "$PathToLMPoliciesToWifi\AllowAutoConnectToWiFiSenseHotspots")) { Set-ItemPropertyVerified -Path "$PathToLMPoliciesToWifi\AllowAutoConnectToWiFiSenseHotspots" -Name "value" -Type DWord -Value $Zero
New-Item -Path "$PathToLMPoliciesToWifi\AllowAutoConnectToWiFiSenseHotspots" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMPoliciesToWifi\AllowAutoConnectToWiFiSenseHotspots" -Name "value" -Type DWord -Value $Zero
Write-Caption "Deleting useless registry keys..." Write-Caption "Deleting useless registry keys..."
$KeysToDelete = @( $KeysToDelete = @(
@ -325,12 +286,7 @@ function Optimize-Privacy() {
) )
ForEach ($Key in $KeysToDelete) { ForEach ($Key in $KeysToDelete) {
If ((Test-Path $Key)) { Remove-ItemVerified $Key -Recurse
Write-Status -Types "-", $TweakType -Status "Removing Key: [$Key]"
Remove-Item $Key -Recurse
} Else {
Write-Status -Types "?", $TweakType -Status "The registry key $Key does not exist" -Warning
}
} }
} }

@ -1,5 +1,6 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"get-hardware-info.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"get-hardware-info.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"set-item-property-verified.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\utils\"individual-tweaks.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\utils\"individual-tweaks.psm1"
# Adapted from: https://youtu.be/xz3oXHleKoM # Adapted from: https://youtu.be/xz3oXHleKoM
@ -23,7 +24,7 @@ function Optimize-Security() {
Write-Section -Text "Windows Defender" Write-Section -Text "Windows Defender"
Write-Status -Types "?", $TweakType -Status "If you already use another antivirus, nothing will happen." -Warning Write-Status -Types "?", $TweakType -Status "If you already use another antivirus, nothing will happen." -Warning
Write-Status -Types "+", $TweakType -Status "Ensuring your Windows Defender is ENABLED..." Write-Status -Types "+", $TweakType -Status "Ensuring your Windows Defender is ENABLED..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware" -Type DWORD -Value 0 -Force Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware" -Type DWORD -Value 0
Set-MpPreference -DisableRealtimeMonitoring $false -Force Set-MpPreference -DisableRealtimeMonitoring $false -Force
Write-Status -Types "+", $TweakType -Status "Enabling Microsoft Defender Exploit Guard network protection..." Write-Status -Types "+", $TweakType -Status "Enabling Microsoft Defender Exploit Guard network protection..."
@ -34,13 +35,10 @@ function Optimize-Security() {
Write-Section -Text "SmartScreen" Write-Section -Text "SmartScreen"
Write-Status -Types "+", $TweakType -Status "Enabling 'SmartScreen' for Microsoft Edge..." Write-Status -Types "+", $TweakType -Status "Enabling 'SmartScreen' for Microsoft Edge..."
If (!(Test-Path "$PathToLMPoliciesEdge\PhishingFilter")) { Set-ItemPropertyVerified -Path "$PathToLMPoliciesEdge\PhishingFilter" -Name "EnabledV9" -Type DWord -Value 1
New-Item -Path "$PathToLMPoliciesEdge\PhishingFilter" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMPoliciesEdge\PhishingFilter" -Name "EnabledV9" -Type DWord -Value 1
Write-Status -Types "+", $TweakType -Status "Enabling 'SmartScreen' for Store Apps..." Write-Status -Types "+", $TweakType -Status "Enabling 'SmartScreen' for Store Apps..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" -Name "EnableWebContentEvaluation" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" -Name "EnableWebContentEvaluation" -Type DWord -Value 1
Write-Section -Text "Old SMB Protocol" Write-Section -Text "Old SMB Protocol"
# Details: https://techcommunity.microsoft.com/t5/storage-at-microsoft/stop-using-smb1/ba-p/425858 # Details: https://techcommunity.microsoft.com/t5/storage-at-microsoft/stop-using-smb1/ba-p/425858
@ -50,42 +48,33 @@ function Optimize-Security() {
Write-Section -Text "Old .NET cryptography" Write-Section -Text "Old .NET cryptography"
# Enable strong cryptography for .NET Framework (version 4 and above) - https://stackoverflow.com/a/47682111 # Enable strong cryptography for .NET Framework (version 4 and above) - https://stackoverflow.com/a/47682111
Write-Status -Types "+", $TweakType -Status "Enabling .NET strong cryptography..." Write-Status -Types "+", $TweakType -Status "Enabling .NET strong cryptography..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319" -Name "SchUseStrongCrypto" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319" -Name "SchUseStrongCrypto" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319" -Name "SchUseStrongCrypto" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319" -Name "SchUseStrongCrypto" -Type DWord -Value 1
Write-Section -Text "Autoplay and Autorun (Removable Devices)" Write-Section -Text "Autoplay and Autorun (Removable Devices)"
Write-Status -Types "-", $TweakType -Status "Disabling Autoplay..." Write-Status -Types "-", $TweakType -Status "Disabling Autoplay..."
Set-ItemProperty -Path "$PathToCUExplorer\AutoplayHandlers" -Name "DisableAutoplay" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "$PathToCUExplorer\AutoplayHandlers" -Name "DisableAutoplay" -Type DWord -Value 1
Write-Status -Types "-", $TweakType -Status "Disabling Autorun for all Drives..." Write-Status -Types "-", $TweakType -Status "Disabling Autorun for all Drives..."
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer")) { Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "NoDriveTypeAutoRun" -Type DWord -Value 255
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "NoDriveTypeAutoRun" -Type DWord -Value 255
Write-Section -Text "Microsoft Store" Write-Section -Text "Microsoft Store"
Disable-SearchAppForUnknownExt Disable-SearchAppForUnknownExt
Write-Section -Text "Windows Explorer" Write-Section -Text "Windows Explorer"
Write-Status -Types "+", $TweakType -Status "Enabling Show file extensions in Explorer..." Write-Status -Types "+", $TweakType -Status "Enabling Show file extensions in Explorer..."
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "HideFileExt" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "$PathToCUExplorerAdvanced" -Name "HideFileExt" -Type DWord -Value 0
Write-Section -Text "User Account Control (UAC)" Write-Section -Text "User Account Control (UAC)"
# Details: https://docs.microsoft.com/en-us/windows/security/identity-protection/user-account-control/user-account-control-group-policy-and-registry-key-settings # Details: https://docs.microsoft.com/en-us/windows/security/identity-protection/user-account-control/user-account-control-group-policy-and-registry-key-settings
Write-Status -Types "+", $TweakType -Status "Raising UAC level..." Write-Status -Types "+", $TweakType -Status "Raising UAC level..."
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System")) { Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Type DWord -Value 5
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Force | Out-Null Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Type DWord -Value 1
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Type DWord -Value 5
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Type DWord -Value 1
Write-Section -Text "Windows Update" Write-Section -Text "Windows Update"
# Details: https://forums.malwarebytes.com/topic/246740-new-potentially-unwanted-modification-disablemrt/ # Details: https://forums.malwarebytes.com/topic/246740-new-potentially-unwanted-modification-disablemrt/
Write-Status -Types "+", $TweakType -Status "Enabling offer Malicious Software Removal Tool via Windows Update..." Write-Status -Types "+", $TweakType -Status "Enabling offer Malicious Software Removal Tool via Windows Update..."
If (!(Test-Path "$PathToLMPoliciesMRT")) { Set-ItemPropertyVerified -Path "$PathToLMPoliciesMRT" -Name "DontOfferThroughWUAU" -Type DWord -Value 0
New-Item -Path "$PathToLMPoliciesMRT" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMPoliciesMRT" -Name "DontOfferThroughWUAU" -Type DWord -Value 0
Write-Status -Types "?", $TweakType -Status "For more tweaks, edit the '$PSCommandPath' file, then uncomment '#SomethingHere' code lines" -Warning Write-Status -Types "?", $TweakType -Status "For more tweaks, edit the '$PSCommandPath' file, then uncomment '#SomethingHere' code lines" -Warning
# Consumes more RAM - Make Windows Defender run in Sandbox Mode (MsMpEngCP.exe and MsMpEng.exe will run on background) # Consumes more RAM - Make Windows Defender run in Sandbox Mode (MsMpEngCP.exe and MsMpEng.exe will run on background)
@ -95,7 +84,7 @@ function Optimize-Security() {
# Disable Windows Script Host. CAREFUL, this may break stuff, including software uninstall. # Disable Windows Script Host. CAREFUL, this may break stuff, including software uninstall.
#Write-Status -Types "+", $TweakType -Status "Disabling Windows Script Host (execution of *.vbs scripts and alike)..." #Write-Status -Types "+", $TweakType -Status "Disabling Windows Script Host (execution of *.vbs scripts and alike)..."
#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name "Enabled" -Type DWord -Value 0 #Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name "Enabled" -Type DWord -Value 0
} }
function Main() { function Main() {

@ -1,5 +1,5 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"scheduled-task-handler.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"scheduled-task-handler.psm1"
# Adapted from: https://youtu.be/qWESrvP_uU8 # Adapted from: https://youtu.be/qWESrvP_uU8
# Adapted from: https://github.com/ChrisTitusTech/win10script # Adapted from: https://github.com/ChrisTitusTech/win10script

@ -1,5 +1,5 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"windows-feature-handler.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"windows-feature-handler.psm1"
# Adapted from: https://github.com/ChrisTitusTech/win10script/pull/131/files # Adapted from: https://github.com/ChrisTitusTech/win10script/pull/131/files

@ -2,6 +2,7 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"manage-software.psm1
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"select-folder-gui.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"select-folder-gui.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"show-dialog-window.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"show-dialog-window.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"title-templates.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"title-templates.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\debloat-helper\"remove-item-verified.psm1"
function Request-AdminPrivilege() { function Request-AdminPrivilege() {
# Used from https://stackoverflow.com/a/31602095 because it preserves the working directory! # Used from https://stackoverflow.com/a/31602095 because it preserves the working directory!
@ -106,7 +107,7 @@ function Set-SSHKey() {
If (!(Test-Path "$SSHPath")) { If (!(Test-Path "$SSHPath")) {
Write-Host "Creating folder on '$SSHPath'" Write-Host "Creating folder on '$SSHPath'"
mkdir "$SSHPath" | Out-Null New-Item -Path "$SSHPath" | Out-Null
} }
Push-Location "$SSHPath" Push-Location "$SSHPath"
@ -135,7 +136,7 @@ function Set-GPGKey() {
If (!(Test-Path "$GnuPGPath")) { If (!(Test-Path "$GnuPGPath")) {
Write-Host "Creating folder on '$GnuPGPath'" Write-Host "Creating folder on '$GnuPGPath'"
mkdir "$GnuPGPath" | Out-Null New-Item -Path "$GnuPGPath" | Out-Null
} }
Push-Location "$GnuPGPath" Push-Location "$GnuPGPath"
@ -160,8 +161,8 @@ function Set-GPGKey() {
Write-Host "Copying all files to $GnuPGPath" Write-Host "Copying all files to $GnuPGPath"
Copy-Item -Path "$GnuPGGeneratePath/*" -Destination "$GnuPGPath/" -Recurse Copy-Item -Path "$GnuPGGeneratePath/*" -Destination "$GnuPGPath/" -Recurse
Remove-Item -Path "$GnuPGPath/*" -Exclude "*.gpg", "*.key", "*.pub", "*.rev" -Recurse Remove-ItemVerified -Path "$GnuPGPath/*" -Exclude "*.gpg", "*.key", "*.pub", "*.rev" -Recurse
Remove-Item -Path "$GnuPGPath/trustdb.gpg" Remove-ItemVerified -Path "$GnuPGPath/trustdb.gpg"
Write-Host "Export public and private key to files:`n- $GnuPGPath\$($GnuPGFileName)_public.gpg`n- $GnuPGPath\$($GnuPGFileName)_secret.gpg" Write-Host "Export public and private key to files:`n- $GnuPGPath\$($GnuPGFileName)_public.gpg`n- $GnuPGPath\$($GnuPGFileName)_secret.gpg"
gpg --output "$($GnuPGFileName)_public.gpg" --armor --export "$(git config --global user.email)" gpg --output "$($GnuPGFileName)_public.gpg" --armor --export "$(git config --global user.email)"

@ -1,6 +1,7 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"download-web-file.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"download-web-file.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"get-hardware-info.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"get-hardware-info.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"title-templates.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"title-templates.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\debloat-helper\"remove-item-verified.psm1"
function Install-ArchWSL() { function Install-ArchWSL() {
$OSArchList = Get-OSArchitecture $OSArchList = Get-OSArchitecture
@ -17,8 +18,8 @@ function Install-ArchWSL() {
Write-Status -Types "+" -Status "Installing ArchWSL ($OSArch)..." Write-Status -Types "+" -Status "Installing ArchWSL ($OSArch)..."
Add-AppxPackage -Path $ArchWSLOutput Add-AppxPackage -Path $ArchWSLOutput
Write-Status -Types "@" -Status "Removing downloaded files..." Write-Status -Types "@" -Status "Removing downloaded files..."
Remove-Item -Path $CertOutput Remove-ItemVerified -Path $CertOutput
Remove-Item -Path $ArchWSLOutput Remove-ItemVerified -Path $ArchWSLOutput
} Else { } Else {
Write-Status -Types "?" -Status "$OSArch is NOT supported!" -Warning Write-Status -Types "?" -Status "$OSArch is NOT supported!" -Warning
Break Break

@ -1,6 +1,7 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"download-web-file.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"download-web-file.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"install-font.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"install-font.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"title-templates.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"title-templates.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\debloat-helper\"remove-item-verified.psm1"
$FontsFolder = "fonts" $FontsFolder = "fonts"
@ -18,7 +19,7 @@ function Install-NerdFont() {
Write-Status -Types "+" -Status "Installing downloaded fonts on $pwd\$FontsFolder..." Write-Status -Types "+" -Status "Installing downloaded fonts on $pwd\$FontsFolder..."
Install-Font -FontSourceFolder "$FontsFolder" Install-Font -FontSourceFolder "$FontsFolder"
Write-Status -Types "@" -Status "Cleaning up..." Write-Status -Types "@" -Status "Cleaning up..."
Remove-Item -Path "$FontsFolder" -Recurse Remove-ItemVerified -Path "$FontsFolder" -Recurse
Pop-Location Pop-Location
} }

@ -2,6 +2,8 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"download-web-file.ps
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"get-hardware-info.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"get-hardware-info.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"manage-software.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"manage-software.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"title-templates.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"title-templates.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\debloat-helper\"remove-item-verified.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\debloat-helper\"set-item-property-verified.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\debloat-helper\"windows-feature-handler.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\debloat-helper\"windows-feature-handler.psm1"
function Install-WSL() { function Install-WSL() {
@ -10,13 +12,13 @@ function Install-WSL() {
Write-Status -Types "+", $TweakType -Status "Enabling Install updates to other Microsoft products (auto-update WSL and other products)..." Write-Status -Types "+", $TweakType -Status "Enabling Install updates to other Microsoft products (auto-update WSL and other products)..."
# [@] (0 = Do not install updates to other Microsoft products , 1 = Install updates to other Microsoft products) # [@] (0 = Do not install updates to other Microsoft products , 1 = Install updates to other Microsoft products)
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AllowMUUpdateService" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AllowMUUpdateService" -Type DWord -Value 1
If ([System.Environment]::OSVersion.Version.Build -eq 14393) { If ([System.Environment]::OSVersion.Version.Build -eq 14393) {
# 1607 needs developer mode to be enabled for older Windows 10 versions # 1607 needs developer mode to be enabled for older Windows 10 versions
Write-Status -Types "+", $TweakType -Status "Enabling Development mode w/out license and trusted apps (Win 10 1607)" Write-Status -Types "+", $TweakType -Status "Enabling Development mode w/out license and trusted apps (Win 10 1607)"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowDevelopmentWithoutDevLicense" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowDevelopmentWithoutDevLicense" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowAllTrustedApps" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowAllTrustedApps" -Type DWord -Value 1
} }
Set-OptionalFeatureState -State 'Enabled' -OptionalFeatures @("VirtualMachinePlatform", "HypervisorPlatform") # VM Platform / Hypervisor Platform from Windows Set-OptionalFeatureState -State 'Enabled' -OptionalFeatures @("VirtualMachinePlatform", "HypervisorPlatform") # VM Platform / Hypervisor Platform from Windows
@ -27,7 +29,7 @@ function Install-WSL() {
Invoke-Expression "$CheckExistenceBlock" | Out-Host Invoke-Expression "$CheckExistenceBlock" | Out-Host
If ($LASTEXITCODE) { Throw "Couldn't install WSL" } # 0 = False, 1 = True If ($LASTEXITCODE) { Throw "Couldn't install WSL" } # 0 = False, 1 = True
Set-OptionalFeatureState -Disabled -OptionalFeatures @("Microsoft-Windows-Subsystem-Linux") # WSL (Old) Set-OptionalFeatureState -State 'Disabled' -OptionalFeatures @("Microsoft-Windows-Subsystem-Linux") # WSL (Old)
} Catch { } Catch {
Write-Status -Types "?", $TweakType -Status "Couldn't install WSL..." -Warning Write-Status -Types "?", $TweakType -Status "Couldn't install WSL..." -Warning
} }
@ -48,7 +50,7 @@ function Install-WSLTwo() {
$WSLOutput = Request-FileDownload -FileURI "https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_$OSArch.msi" -OutputFile "wsl_update.msi" $WSLOutput = Request-FileDownload -FileURI "https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_$OSArch.msi" -OutputFile "wsl_update.msi"
Write-Status -Types "+", $TweakType -Status "Installing WSL Update ($OSArch)..." Write-Status -Types "+", $TweakType -Status "Installing WSL Update ($OSArch)..."
Start-Process -FilePath $WSLOutput -ArgumentList "/passive" -Wait Start-Process -FilePath $WSLOutput -ArgumentList "/passive" -Wait
Remove-Item -Path $WSLOutput Remove-ItemVerified -Path $WSLOutput
wsl --set-default-version 2 | Out-Host wsl --set-default-version 2 | Out-Host
} Else { } Else {

@ -1,4 +1,5 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"title-templates.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\"title-templates.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\..\lib\debloat-helper\"set-item-property-verified.psm1"
function New-SystemColor() { function New-SystemColor() {
$ColorHistory = Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\History\Colors" $ColorHistory = Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\History\Colors"
@ -44,41 +45,41 @@ function New-SystemColor() {
Write-Verbose "$RandomBytes" Write-Verbose "$RandomBytes"
# Taskbar and Settings color # Taskbar and Settings color
Set-ItemProperty -Path "$PathToCUExplorerAccent" -Name "AccentPalette" -Type Binary -Value ([byte[]]($RandomBytes[0], $RandomBytes[1], $RandomBytes[2], $RandomBytes[3], $RandomBytes[4], $RandomBytes[5], $RandomBytes[6], $RandomBytes[7], $RandomBytes[8], $RandomBytes[9], $RandomBytes[10], $RandomBytes[11], $RandomBytes[12], $RandomBytes[13], $RandomBytes[14], $RandomBytes[15], $RandomBytes[16], $RandomBytes[17], $RandomBytes[18], $RandomBytes[19], $RandomBytes[20], $RandomBytes[21], $RandomBytes[22], $RandomBytes[23], $RandomBytes[24], $RandomBytes[25], $RandomBytes[26], $RandomBytes[27], $RandomBytes[28], $RandomBytes[29], $RandomBytes[30], $RandomBytes[31])) Set-ItemPropertyTested -Path "$PathToCUExplorerAccent" -Name "AccentPalette" -Type Binary -Value ([byte[]]($RandomBytes[0], $RandomBytes[1], $RandomBytes[2], $RandomBytes[3], $RandomBytes[4], $RandomBytes[5], $RandomBytes[6], $RandomBytes[7], $RandomBytes[8], $RandomBytes[9], $RandomBytes[10], $RandomBytes[11], $RandomBytes[12], $RandomBytes[13], $RandomBytes[14], $RandomBytes[15], $RandomBytes[16], $RandomBytes[17], $RandomBytes[18], $RandomBytes[19], $RandomBytes[20], $RandomBytes[21], $RandomBytes[22], $RandomBytes[23], $RandomBytes[24], $RandomBytes[25], $RandomBytes[26], $RandomBytes[27], $RandomBytes[28], $RandomBytes[29], $RandomBytes[30], $RandomBytes[31]))
# Window Top Color # Window Top Color
Set-ItemProperty -Path "$PathToCUWindowsDWM" -Name "AccentColor" -Type DWord -Value 0xff$HexColor Set-ItemPropertyTested -Path "$PathToCUWindowsDWM" -Name "AccentColor" -Type DWord -Value 0xff$HexColor
Set-ItemProperty -Path "$PathToCUWindowsDWM" -Name "ColorizationAfterglow" -Type DWord -Value 0xc4$HexColor Set-ItemPropertyTested -Path "$PathToCUWindowsDWM" -Name "ColorizationAfterglow" -Type DWord -Value 0xc4$HexColor
Set-ItemProperty -Path "$PathToCUWindowsDWM" -Name "ColorizationColor" -Type DWord -Value 0xc4$HexColor Set-ItemPropertyTested -Path "$PathToCUWindowsDWM" -Name "ColorizationColor" -Type DWord -Value 0xc4$HexColor
# Window Border Color # Window Border Color
Set-ItemProperty -Path "$PathToCUExplorerAccent" -Name "AccentColorMenu" -Type DWord -Value 0xff$HexColorBGR Set-ItemPropertyTested -Path "$PathToCUExplorerAccent" -Name "AccentColorMenu" -Type DWord -Value 0xff$HexColorBGR
Set-ItemProperty -Path "$PathToCUExplorerAccent" -Name "StartColorMenu" -Type DWord -Value 0xff$HexColor Set-ItemPropertyTested -Path "$PathToCUExplorerAccent" -Name "StartColorMenu" -Type DWord -Value 0xff$HexColor
# Start, Taskbar and Action center # Start, Taskbar and Action center
Set-ItemProperty -Path "$PathToCUThemesPersonalize" -Name "ColorPrevalence" -Type DWord -Value 0 Set-ItemPropertyTested -Path "$PathToCUThemesPersonalize" -Name "ColorPrevalence" -Type DWord -Value 0
# Title Bars and Windows Borders # Title Bars and Windows Borders
Set-ItemProperty -Path "$PathToCUWindowsDWM" -Name "ColorPrevalence" -Type DWord -Value 1 Set-ItemPropertyTested -Path "$PathToCUWindowsDWM" -Name "ColorPrevalence" -Type DWord -Value 1
# Window Color History # Window Color History
Set-ItemProperty -Path "$PathToCUThemesColorHistory" -Name "ColorHistory0" -Type DWord -Value 0xff$HexColorBGR Set-ItemPropertyTested -Path "$PathToCUThemesColorHistory" -Name "ColorHistory0" -Type DWord -Value 0xff$HexColorBGR
Set-ItemProperty -Path "$PathToCUThemesColorHistory" -Name "ColorHistory1" -Type DWord -Value $ColorHistory.ColorHistory0 Set-ItemPropertyTested -Path "$PathToCUThemesColorHistory" -Name "ColorHistory1" -Type DWord -Value $ColorHistory.ColorHistory0
Set-ItemProperty -Path "$PathToCUThemesColorHistory" -Name "ColorHistory2" -Type DWord -Value $ColorHistory.ColorHistory1 Set-ItemPropertyTested -Path "$PathToCUThemesColorHistory" -Name "ColorHistory2" -Type DWord -Value $ColorHistory.ColorHistory1
Set-ItemProperty -Path "$PathToCUThemesColorHistory" -Name "ColorHistory3" -Type DWord -Value $ColorHistory.ColorHistory2 Set-ItemPropertyTested -Path "$PathToCUThemesColorHistory" -Name "ColorHistory3" -Type DWord -Value $ColorHistory.ColorHistory2
Set-ItemProperty -Path "$PathToCUThemesColorHistory" -Name "ColorHistory4" -Type DWord -Value $ColorHistory.ColorHistory3 Set-ItemPropertyTested -Path "$PathToCUThemesColorHistory" -Name "ColorHistory4" -Type DWord -Value $ColorHistory.ColorHistory3
Set-ItemProperty -Path "$PathToCUThemesColorHistory" -Name "ColorHistory5" -Type DWord -Value $ColorHistory.ColorHistory4 Set-ItemPropertyTested -Path "$PathToCUThemesColorHistory" -Name "ColorHistory5" -Type DWord -Value $ColorHistory.ColorHistory4
# Miscellaneous stuff (didn't work) # Miscellaneous stuff (didn't work)
Set-ItemProperty -Path "$PathToCUWindowsDWM" -Name "ColorizationAfterglowBalance" -Type DWord -Value 10 Set-ItemPropertyTested -Path "$PathToCUWindowsDWM" -Name "ColorizationAfterglowBalance" -Type DWord -Value 10
# Set-ItemProperty -Path "$PathToCUWindowsDWM" -Name "ColorizationBlurBalance" -Type DWord -Value 1 # Set-ItemPropertyTested -Path "$PathToCUWindowsDWM" -Name "ColorizationBlurBalance" -Type DWord -Value 1
Set-ItemProperty -Path "$PathToCUWindowsDWM" -Name "ColorizationColorBalance" -Type DWord -Value 89 Set-ItemPropertyTested -Path "$PathToCUWindowsDWM" -Name "ColorizationColorBalance" -Type DWord -Value 89
Set-ItemProperty -Path "$PathToCUWindowsDWM" -Name "ColorizationGlassAttribute" -Type DWord -Value 0 Set-ItemPropertyTested -Path "$PathToCUWindowsDWM" -Name "ColorizationGlassAttribute" -Type DWord -Value 0
Set-ItemProperty -Path "$PathToCUWindowsDWM" -Name "ColorizationGlassAttribute" -Type DWord -Value 1 Set-ItemPropertyTested -Path "$PathToCUWindowsDWM" -Name "ColorizationGlassAttribute" -Type DWord -Value 1
Set-ItemProperty -Path "$PathToCUWindowsDWM" -Name "EnableWindowColorization" -Type DWord -Value 1 Set-ItemPropertyTested -Path "$PathToCUWindowsDWM" -Name "EnableWindowColorization" -Type DWord -Value 1
Set-ItemProperty -Path "$PathToCUDesktop" -Name "AutoColorization" -Type DWord -Value 0 Set-ItemPropertyTested -Path "$PathToCUDesktop" -Name "AutoColorization" -Type DWord -Value 0
Set-ItemProperty -Path "$PathToCUThemesHistory" -Name "AutoColor" -Type DWord -Value 0 Set-ItemPropertyTested -Path "$PathToCUThemesHistory" -Name "AutoColor" -Type DWord -Value 0
} }
New-SystemColor New-SystemColor

@ -1,5 +1,7 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"open-file.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"open-file.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"remove-item-verified.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"set-item-property-verified.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\utils\"individual-tweaks.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\utils\"individual-tweaks.psm1"
# Adapted from: https://github.com/ChrisTitusTech/win10script # Adapted from: https://github.com/ChrisTitusTech/win10script
@ -62,154 +64,123 @@ function Register-PersonalTweaksList() {
} Until ($preferences) } Until ($preferences)
Stop-Process $taskmgr Stop-Process $taskmgr
$preferences.Preferences[28] = 0 $preferences.Preferences[28] = 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Name "Preferences" -Type Binary -Value $preferences.Preferences Set-ItemPropertyVerified -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Name "Preferences" -Type Binary -Value $preferences.Preferences
} Else { } Else {
Write-Status -Types "?", $TweakType -Status "Task Manager patch not run in builds 22557+ due to bug" -Warning Write-Status -Types "?", $TweakType -Status "Task Manager patch not run in builds 22557+ due to bug" -Warning
} }
Write-Section -Text "Windows Explorer Tweaks" Write-Section -Text "Windows Explorer Tweaks"
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Quick Access from Windows Explorer..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Quick Access from Windows Explorer..."
Set-ItemProperty -Path "$PathToCUExplorer" -Name "ShowFrequent" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "$PathToCUExplorer" -Name "ShowFrequent" -Type DWord -Value $Zero
Set-ItemProperty -Path "$PathToCUExplorer" -Name "ShowRecent" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "$PathToCUExplorer" -Name "ShowRecent" -Type DWord -Value $Zero
Set-ItemProperty -Path "$PathToCUExplorer" -Name "HubMode" -Type DWord -Value $One Set-ItemPropertyVerified -Path "$PathToCUExplorer" -Name "HubMode" -Type DWord -Value $One
Write-Status -Types "-", $TweakType -Status "Removing 3D Objects from This PC..." Write-Status -Types "-", $TweakType -Status "Removing 3D Objects from This PC..."
If (Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}") { Remove-ItemVerified -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" -Recurse
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" -Recurse Remove-ItemVerified -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" -Recurse
}
If (Test-Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}") {
Remove-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" -Recurse
}
Write-Status -Types "-", $TweakType -Status "Removing 'Edit with Paint 3D' from the Context Menu..." Write-Status -Types "-", $TweakType -Status "Removing 'Edit with Paint 3D' from the Context Menu..."
$Paint3DFileTypes = @(".3mf", ".bmp", ".fbx", ".gif", ".jfif", ".jpe", ".jpeg", ".jpg", ".png", ".tif", ".tiff") $Paint3DFileTypes = @(".3mf", ".bmp", ".fbx", ".gif", ".jfif", ".jpe", ".jpeg", ".jpg", ".png", ".tif", ".tiff")
ForEach ($FileType in $Paint3DFileTypes) { ForEach ($FileType in $Paint3DFileTypes) {
If (Test-Path "Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\$FileType\Shell\3D Edit") { Write-Status -Types "-", $TweakType -Status "Removing Paint 3D from file type: $FileType"
Write-Status -Types "-", $TweakType -Status "Removing Paint 3D from file type: $FileType" Remove-ItemVerified -Path "Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\$FileType\Shell\3D Edit" -Recurse
Remove-Item -Path "Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\$FileType\Shell\3D Edit" -Recurse
}
} }
Write-Status -Types $EnableStatus[1].Symbol, $TweakType -Status "$($EnableStatus[1].Status) Show Drives without Media..." Write-Status -Types $EnableStatus[1].Symbol, $TweakType -Status "$($EnableStatus[1].Status) Show Drives without Media..."
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "HideDrivesWithNoMedia" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "$PathToCUExplorerAdvanced" -Name "HideDrivesWithNoMedia" -Type DWord -Value $Zero
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) MRU lists (jump lists) of XAML apps in Start Menu..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) MRU lists (jump lists) of XAML apps in Start Menu..."
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "Start_TrackDocs" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "$PathToCUExplorerAdvanced" -Name "Start_TrackDocs" -Type DWord -Value $Zero
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "Start_TrackProgs" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "$PathToCUExplorerAdvanced" -Name "Start_TrackProgs" -Type DWord -Value $Zero
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Aero-Shake Minimize feature..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Aero-Shake Minimize feature..."
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "DisallowShaking" -Type DWord -Value $One Set-ItemPropertyVerified -Path "$PathToCUExplorerAdvanced" -Name "DisallowShaking" -Type DWord -Value $One
Write-Status -Types "+", $TweakType -Status "Setting Windows Explorer to start on This PC instead of Quick Access..." Write-Status -Types "+", $TweakType -Status "Setting Windows Explorer to start on This PC instead of Quick Access..."
# [@] (1 = This PC, 2 = Quick access) # DO NOT REVERT, BREAKS EXPLORER.EXE # [@] (1 = This PC, 2 = Quick access) # DO NOT REVERT, BREAKS EXPLORER.EXE
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "LaunchTo" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "$PathToCUExplorerAdvanced" -Name "LaunchTo" -Type DWord -Value 1
Write-Status -Types $EnableStatus[1].Symbol, $TweakType -Status "$($EnableStatus[1].Status) Show hidden files in Explorer..." Write-Status -Types $EnableStatus[1].Symbol, $TweakType -Status "$($EnableStatus[1].Status) Show hidden files in Explorer..."
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "Hidden" -Type DWord -Value $One Set-ItemPropertyVerified -Path "$PathToCUExplorerAdvanced" -Name "Hidden" -Type DWord -Value $One
Write-Status -Types $EnableStatus[1].Symbol, $TweakType -Status "$($EnableStatus[1].Status) Showing file transfer details..." Write-Status -Types $EnableStatus[1].Symbol, $TweakType -Status "$($EnableStatus[1].Status) Showing file transfer details..."
If (!(Test-Path "$PathToCUExplorer\OperationStatusManager")) { Set-ItemPropertyVerified -Path "$PathToCUExplorer\OperationStatusManager" -Name "EnthusiastMode" -Type DWord -Value $One
New-Item -Path "$PathToCUExplorer\OperationStatusManager" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToCUExplorer\OperationStatusManager" -Name "EnthusiastMode" -Type DWord -Value $One
Write-Status -Types "-", $TweakType -Status "Disabling '- Shortcut' name after creating a shortcut..." Write-Status -Types "-", $TweakType -Status "Disabling '- Shortcut' name after creating a shortcut..."
Set-ItemProperty -Path "$PathToCUExplorer" -Name "link" -Type Binary -Value ([byte[]](0x00, 0x00, 0x00, 0x00)) Set-ItemPropertyVerified -Path "$PathToCUExplorer" -Name "link" -Type Binary -Value ([byte[]](0x00, 0x00, 0x00, 0x00))
Write-Section -Text "Task Bar Tweaks" Write-Section -Text "Task Bar Tweaks"
Write-Caption -Text "Task Bar - Windows 10 Compatible" Write-Caption -Text "Task Bar - Windows 10 Compatible"
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) the 'Search Box' from taskbar..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) the 'Search Box' from taskbar..."
# [@] (0 = Hide completely, 1 = Show icon only, 2 = Show long Search Box) # [@] (0 = Hide completely, 1 = Show icon only, 2 = Show long Search Box)
Set-ItemProperty -Path "$PathToCUWindowsSearch" -Name "SearchboxTaskbarMode" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "$PathToCUWindowsSearch" -Name "SearchboxTaskbarMode" -Type DWord -Value $Zero
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Windows search highlights from taskbar..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Windows search highlights from taskbar..."
If (!(Test-Path "$PathToLMPoliciesWindowsSearch")) { Set-ItemPropertyVerified -Path "$PathToLMPoliciesWindowsSearch" -Name "EnableDynamicContentInWSB" -Type DWord -Value $Zero
New-Item -Path "$PathToLMPoliciesWindowsSearch" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMPoliciesWindowsSearch" -Name "EnableDynamicContentInWSB" -Type DWord -Value $Zero
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) the 'Task View' icon from taskbar..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) the 'Task View' icon from taskbar..."
# [@] (0 = Hide Task view, 1 = Show Task view) # [@] (0 = Hide Task view, 1 = Show Task view)
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "ShowTaskViewButton" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "$PathToCUExplorerAdvanced" -Name "ShowTaskViewButton" -Type DWord -Value $Zero
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Open on Hover from 'News and Interest' from taskbar..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Open on Hover from 'News and Interest' from taskbar..."
If (!(Test-Path "$PathToCUNewsAndInterest")) {
New-Item -Path "$PathToCUNewsAndInterest" -Force | Out-Null
}
# [@] (0 = Disable, 1 = Enable) # [@] (0 = Disable, 1 = Enable)
Set-ItemProperty -Path "$PathToCUNewsAndInterest" -Name "ShellFeedsTaskbarOpenOnHover" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "$PathToCUNewsAndInterest" -Name "ShellFeedsTaskbarOpenOnHover" -Type DWord -Value $Zero
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) 'News and Interest' from taskbar..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) 'News and Interest' from taskbar..."
If (!(Test-Path "$PathToLMPoliciesNewsAndInterest")) {
New-Item -Path "$PathToLMPoliciesNewsAndInterest" -Force | Out-Null
}
# [@] (0 = Disable, 1 = Enable) # [@] (0 = Disable, 1 = Enable)
Set-ItemProperty -Path "$PathToLMPoliciesNewsAndInterest" -Name "EnableFeeds" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "$PathToLMPoliciesNewsAndInterest" -Name "EnableFeeds" -Type DWord -Value $Zero
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) 'People' icon from taskbar..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) 'People' icon from taskbar..."
If (!(Test-Path "$PathToCUExplorerAdvanced\People")) { Set-ItemPropertyVerified -Path "$PathToCUExplorerAdvanced\People" -Name "PeopleBand" -Type DWord -Value $Zero
New-Item -Path "$PathToCUExplorerAdvanced\People" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToCUExplorerAdvanced\People" -Name "PeopleBand" -Type DWord -Value $Zero
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Live Tiles..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Live Tiles..."
If (!(Test-Path "$PathToCUPoliciesLiveTiles")) { Set-ItemPropertyVerified -Path $PathToCUPoliciesLiveTiles -Name "NoTileApplicationNotification" -Type DWord -Value $One
New-Item -Path "$PathToCUPoliciesLiveTiles" -Force | Out-Null
}
Set-ItemProperty -Path $PathToCUPoliciesLiveTiles -Name "NoTileApplicationNotification" -Type DWord -Value $One
Write-Status -Types "*", $TweakType -Status "Enabling Auto tray icons..." Write-Status -Types "*", $TweakType -Status "Enabling Auto tray icons..."
Set-ItemProperty -Path "$PathToCUExplorer" -Name "EnableAutoTray" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "$PathToCUExplorer" -Name "EnableAutoTray" -Type DWord -Value 1
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) 'Meet now' icon on taskbar..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) 'Meet now' icon on taskbar..."
If (!(Test-Path "$PathToLMPoliciesExplorer")) {
New-Item -Path "$PathToLMPoliciesExplorer" -Force | Out-Null
}
# [@] (0 = Show Meet Now, 1 = Hide Meet Now) # [@] (0 = Show Meet Now, 1 = Hide Meet Now)
Set-ItemProperty -Path "$PathToLMPoliciesExplorer" -Name "HideSCAMeetNow" -Type DWord -Value $One Set-ItemPropertyVerified -Path "$PathToLMPoliciesExplorer" -Name "HideSCAMeetNow" -Type DWord -Value $One
Write-Caption -Text "Task Bar - Windows 11 Compatible" Write-Caption -Text "Task Bar - Windows 11 Compatible"
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) 'Widgets' icon from taskbar..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) 'Widgets' icon from taskbar..."
# [@] (0 = Hide Widgets, 1 = Show Widgets) # [@] (0 = Hide Widgets, 1 = Show Widgets)
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "TaskbarDa" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "$PathToCUExplorerAdvanced" -Name "TaskbarDa" -Type DWord -Value $Zero
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) 'Chat' icon from taskbar..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) 'Chat' icon from taskbar..."
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "TaskbarMn" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "$PathToCUExplorerAdvanced" -Name "TaskbarMn" -Type DWord -Value $Zero
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) creation of Thumbs.db thumbnail cache files..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) creation of Thumbs.db thumbnail cache files..."
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "DisableThumbnailCache" -Type DWord -Value $One Set-ItemPropertyVerified -Path "$PathToCUExplorerAdvanced" -Name "DisableThumbnailCache" -Type DWord -Value $One
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "DisableThumbsDBOnNetworkFolders" -Type DWord -Value $One Set-ItemPropertyVerified -Path "$PathToCUExplorerAdvanced" -Name "DisableThumbsDBOnNetworkFolders" -Type DWord -Value $One
Write-Caption -Text "Colors" Write-Caption -Text "Colors"
Write-Status -Types "*", $TweakType -Status "Re-Enabling taskbar transparency..." Write-Status -Types "*", $TweakType -Status "Re-Enabling taskbar transparency..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "EnableTransparency" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "EnableTransparency" -Type DWord -Value 1
Write-Section -Text "System" Write-Section -Text "System"
Write-Caption -Text "Multitasking" Write-Caption -Text "Multitasking"
Write-Status -Types "-", $TweakType -Status "Disabling Edge multi tabs showing on Alt + Tab..." Write-Status -Types "-", $TweakType -Status "Disabling Edge multi tabs showing on Alt + Tab..."
Set-ItemProperty -Path "$PathToCUExplorerAdvanced" -Name "MultiTaskingAltTabFilter" -Type DWord -Value 3 Set-ItemPropertyVerified -Path "$PathToCUExplorerAdvanced" -Name "MultiTaskingAltTabFilter" -Type DWord -Value 3
Write-Section -Text "Devices" Write-Section -Text "Devices"
Write-Caption -Text "Bluetooth & other devices" Write-Caption -Text "Bluetooth & other devices"
Write-Status -Types $EnableStatus[1].Symbol, $TweakType -Status "$($EnableStatus[1].Status) driver download over metered connections..." Write-Status -Types $EnableStatus[1].Symbol, $TweakType -Status "$($EnableStatus[1].Status) driver download over metered connections..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceSetup" -Name "CostedNetworkPolicy" -Type DWord -Value $One Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceSetup" -Name "CostedNetworkPolicy" -Type DWord -Value $One
Write-Section -Text "Cortana Tweaks" Write-Section -Text "Cortana Tweaks"
Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Bing Search in Start Menu..." Write-Status -Types $EnableStatus[0].Symbol, $TweakType -Status "$($EnableStatus[0].Status) Bing Search in Start Menu..."
Set-ItemProperty -Path "$PathToCUWindowsSearch" -Name "BingSearchEnabled" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "$PathToCUWindowsSearch" -Name "BingSearchEnabled" -Type DWord -Value $Zero
Set-ItemProperty -Path "$PathToCUWindowsSearch" -Name "CortanaConsent" -Type DWord -Value $Zero Set-ItemPropertyVerified -Path "$PathToCUWindowsSearch" -Name "CortanaConsent" -Type DWord -Value $Zero
Set-ItemPropertyVerified -Path "$PathToCUPoliciesExplorer" -Name "DisableSearchBoxSuggestions" -Type DWord -Value $One
If (!(Test-Path "$PathToCUPoliciesExplorer")) {
New-Item -Path "$PathToCUPoliciesExplorer" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToCUPoliciesExplorer" -Name "DisableSearchBoxSuggestions" -Type DWord -Value $One
Write-Section -Text "Ease of Access" Write-Section -Text "Ease of Access"
Write-Caption -Text "Keyboard" Write-Caption -Text "Keyboard"
Write-Status -Types "-", $TweakType -Status "Disabling Sticky Keys..." Write-Status -Types "-", $TweakType -Status "Disabling Sticky Keys..."
Set-ItemProperty -Path "$PathToCUAccessibility\StickyKeys" -Name "Flags" -Value "506" Set-ItemPropertyVerified -Path "$PathToCUAccessibility\StickyKeys" -Name "Flags" -Value "506"
Set-ItemProperty -Path "$PathToCUAccessibility\Keyboard Response" -Name "Flags" -Value "122" Set-ItemPropertyVerified -Path "$PathToCUAccessibility\Keyboard Response" -Name "Flags" -Value "122"
Set-ItemProperty -Path "$PathToCUAccessibility\ToggleKeys" -Name "Flags" -Value "58" Set-ItemPropertyVerified -Path "$PathToCUAccessibility\ToggleKeys" -Name "Flags" -Value "58"
Write-Section -Text "Microsoft Edge Policies" Write-Section -Text "Microsoft Edge Policies"
Write-Caption -Text "Privacy, search and services / Address bar and search" Write-Caption -Text "Privacy, search and services / Address bar and search"
@ -220,7 +191,7 @@ function Register-PersonalTweaksList() {
Remove-ItemProperty -Path "$PathToCUPoliciesEdge" -Name "LocalProvidersEnabled" -Force -ErrorAction SilentlyContinue Remove-ItemProperty -Path "$PathToCUPoliciesEdge" -Name "LocalProvidersEnabled" -Force -ErrorAction SilentlyContinue
Write-Status -Types "*", $TweakType -Status "Re-Enabling Error reporting..." Write-Status -Types "*", $TweakType -Status "Re-Enabling Error reporting..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name "Disabled" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name "Disabled" -Type DWord -Value 0
Write-Status -Types "+", $TweakType -Status "Bringing back F8 alternative Boot Modes..." Write-Status -Types "+", $TweakType -Status "Bringing back F8 alternative Boot Modes..."
bcdedit /set `{current`} bootmenupolicy Legacy bcdedit /set `{current`} bootmenupolicy Legacy

@ -1,5 +1,5 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"uwp-appx-handler.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"uwp-appx-handler.psm1"
function Remove-BloatwareAppsList() { function Remove-BloatwareAppsList() {
$Apps = @( $Apps = @(

@ -1,5 +1,7 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"show-dialog-window.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"show-dialog-window.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"remove-item-verified.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"set-item-property-verified.psm1"
function Main() { function Main() {
$Ask = "Are you sure you want to remove Microsoft Edge from Windows?`nYou can reinstall it anytime.`nNote: all users logged in will remain." $Ask = "Are you sure you want to remove Microsoft Edge from Windows?`nYou can reinstall it anytime.`nNote: all users logged in will remain."
@ -39,17 +41,14 @@ function Remove-MSEdge() {
} }
Write-Status -Types "@" -Status "Preventing Edge from reinstalling..." Write-Status -Types "@" -Status "Preventing Edge from reinstalling..."
If (!(Test-Path "$PathToLMEdgeUpdate")) { Set-ItemPropertyVerified -Path "$PathToLMEdgeUpdate" -Name "DoNotUpdateToEdgeWithChromium" -Type DWord -Value 1
New-Item -Path "$PathToLMEdgeUpdate" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMEdgeUpdate" -Name "DoNotUpdateToEdgeWithChromium" -Type DWord -Value 1
Write-Status -Types "@" -Status "Deleting Edge appdata\local folders from current user..." Write-Status -Types "@" -Status "Deleting Edge appdata\local folders from current user..."
Remove-Item -Path "$env:LOCALAPPDATA\Packages\Microsoft.MicrosoftEdge*_*" -Recurse -Force | Out-Host Remove-ItemVerified -Path "$env:LOCALAPPDATA\Packages\Microsoft.MicrosoftEdge*_*" -Recurse -Force | Out-Host
Write-Status -Types "@" -Status "Deleting Edge from Program Files (x86)..." Write-Status -Types "@" -Status "Deleting Edge from Program Files (x86)..."
Remove-Item -Path "$env:SystemDrive\Program Files (x86)\Microsoft\Edge*" -Recurse -Force | Out-Host Remove-ItemVerified -Path "$env:SystemDrive\Program Files (x86)\Microsoft\Edge*" -Recurse -Force | Out-Host
Remove-Item -Path "$env:SystemDrive\Program Files (x86)\Microsoft\Temp" -Recurse -Force | Out-Host Remove-ItemVerified -Path "$env:SystemDrive\Program Files (x86)\Microsoft\Temp" -Recurse -Force | Out-Host
} }
Main Main

@ -1,4 +1,5 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\original\"New-FolderForced.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"remove-item-verified.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"set-item-property-verified.psm1"
function Remove-OneDrive() { function Remove-OneDrive() {
# Description: This script will remove and disable OneDrive integration. # Description: This script will remove and disable OneDrive integration.
@ -15,24 +16,23 @@ function Remove-OneDrive() {
} }
Write-Host "Removing OneDrive leftovers..." Write-Host "Removing OneDrive leftovers..."
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:localappdata\Microsoft\OneDrive" Remove-ItemVerified -Recurse -Force -ErrorAction SilentlyContinue "$env:localappdata\Microsoft\OneDrive"
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:programdata\Microsoft OneDrive" Remove-ItemVerified -Recurse -Force -ErrorAction SilentlyContinue "$env:programdata\Microsoft OneDrive"
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:systemdrive\OneDriveTemp" Remove-ItemVerified -Recurse -Force -ErrorAction SilentlyContinue "$env:systemdrive\OneDriveTemp"
# check if directory is empty before removing: # check if directory is empty before removing:
If ((Get-ChildItem "$env:userprofile\OneDrive" -Recurse | Measure-Object).Count -eq 0) { If ((Get-ChildItem "$env:userprofile\OneDrive" -Recurse | Measure-Object).Count -eq 0) {
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:userprofile\OneDrive" Remove-ItemVerified -Recurse -Force -ErrorAction SilentlyContinue "$env:userprofile\OneDrive"
} }
Write-Host "Disable OneDrive via Group Policies." Write-Host "Disable OneDrive via Group Policies."
New-FolderForced -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" "DisableFileSyncNGSC" 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" "DisableFileSyncNGSC" 1
Write-Host "Remove Onedrive from explorer sidebar." Write-Host "Remove Onedrive from explorer sidebar."
New-PSDrive -PSProvider "Registry" -Root "HKEY_CLASSES_ROOT" -Name "HKCR" New-PSDrive -PSProvider "Registry" -Root "HKEY_CLASSES_ROOT" -Name "HKCR"
mkdir -Force "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" mkdir -Force "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}"
Set-ItemProperty -Path "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0 Set-ItemPropertyVerified -Path "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0
mkdir -Force "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" mkdir -Force "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}"
Set-ItemProperty -Path "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0 Set-ItemPropertyVerified -Path "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0
Remove-PSDrive "HKCR" Remove-PSDrive "HKCR"
# Thank you Matthew Israelsson # Thank you Matthew Israelsson
@ -42,7 +42,7 @@ function Remove-OneDrive() {
reg unload "hku\Default" reg unload "hku\Default"
Write-Host "Removing startmenu entry..." Write-Host "Removing startmenu entry..."
Remove-Item -Force -ErrorAction SilentlyContinue "$env:userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" Remove-ItemVerified -Force -ErrorAction SilentlyContinue "$env:userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk"
Write-Host "Removing scheduled task..." Write-Host "Removing scheduled task..."
Get-ScheduledTask -TaskPath '\' -TaskName 'OneDrive*' -ea SilentlyContinue | Unregister-ScheduledTask -Confirm:$false Get-ScheduledTask -TaskPath '\' -TaskName 'OneDrive*' -ea SilentlyContinue | Unregister-ScheduledTask -Confirm:$false

@ -1,6 +1,7 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"set-service-startup.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"set-service-startup.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"show-dialog-window.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"show-dialog-window.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"set-item-property-verified.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"uwp-appx-handler.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"uwp-appx-handler.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\utils\"individual-tweaks.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\utils\"individual-tweaks.psm1"
@ -49,10 +50,7 @@ function Remove-Xbox() {
Remove-UWPAppx -AppxPackages $XboxApps Remove-UWPAppx -AppxPackages $XboxApps
Write-Status -Types "-", $TweakType -Status "Disabling Xbox Game Monitoring..." Write-Status -Types "-", $TweakType -Status "Disabling Xbox Game Monitoring..."
If (!(Test-Path "$PathToLMServicesXbgm")) { Set-ItemPropertyVerified -Path "$PathToLMServicesXbgm" -Name "Start" -Type DWord -Value 4
New-Item -Path "$PathToLMServicesXbgm" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMServicesXbgm" -Name "Start" -Type DWord -Value 4
Disable-XboxGameBarDVRandMode Disable-XboxGameBarDVRandMode
} }

@ -1,4 +1,5 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"set-item-property-verified.psm1"
# Adapted from: https://github.com/ChrisTitusTech/win10script # Adapted from: https://github.com/ChrisTitusTech/win10script
@ -45,7 +46,7 @@ function Repair-System() {
Write-Caption -Text "Closing Windows Explorer..." Write-Caption -Text "Closing Windows Explorer..."
taskkill /F /IM explorer.exe taskkill /F /IM explorer.exe
Write-Caption -Text "Re-registering all Windows Apps via AppXManifest.xml ..." Write-Caption -Text "Re-registering all Windows Apps via AppXManifest.xml ..."
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "EnableXamlStartMenu" -Type Dword -Value 0 Set-ItemPropertyVerified -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "EnableXamlStartMenu" -Type Dword -Value 0
Get-AppxPackage -AllUsers | ForEach-Object { Get-AppxPackage -AllUsers | ForEach-Object {
Write-Status -Types "@" -Status "Trying to register package: $($_.InstallLocation)" Write-Status -Types "@" -Status "Trying to register package: $($_.InstallLocation)"
Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml" Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"

@ -1,5 +1,6 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"download-web-file.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"download-web-file.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"remove-item-verified.psm1"
# Adapted from this ChrisTitus script: https://github.com/ChrisTitusTech/win10script # Adapted from this ChrisTitus script: https://github.com/ChrisTitusTech/win10script
@ -14,7 +15,7 @@ function Use-DebloatSoftware() {
$AdwCleanerOutput = Request-FileDownload -FileURI $AdwCleanerDl -OutputFile "adwcleaner.exe" $AdwCleanerOutput = Request-FileDownload -FileURI $AdwCleanerDl -OutputFile "adwcleaner.exe"
Write-Status -Types "+" -Status "Running MalwareBytes AdwCleaner scanner..." Write-Status -Types "+" -Status "Running MalwareBytes AdwCleaner scanner..."
Start-Process -FilePath $AdwCleanerOutput -ArgumentList "/eula", "/clean", "/noreboot" -Wait Start-Process -FilePath $AdwCleanerOutput -ArgumentList "/eula", "/clean", "/noreboot" -Wait
Remove-Item $AdwCleanerOutput -Force Remove-ItemVerified $AdwCleanerOutput -Force
} }
$ShutUpDl = "https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe" $ShutUpDl = "https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe"
@ -30,7 +31,7 @@ function Use-DebloatSoftware() {
Start-Process -FilePath $ShutUpOutput -ArgumentList "ooshutup10.cfg", "/quiet" -Wait # Wait until the process closes # Start-Process -FilePath $ShutUpOutput -ArgumentList "ooshutup10.cfg", "/quiet" -Wait # Wait until the process closes #
} }
Remove-Item "$ShutUpOutput" -Force # Leave no extra files Remove-ItemVerified "$ShutUpOutput" -Force # Leave no extra files
Pop-Location Pop-Location
} }

@ -2,7 +2,9 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"grant-registry-permissi
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"manage-software.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"manage-software.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"new-shortcut.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"new-shortcut.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"remove-item-verified.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"service-startup-handler.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"service-startup-handler.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"set-item-property-verified.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"uwp-appx-handler.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"uwp-appx-handler.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"windows-feature-handler.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"windows-feature-handler.psm1"
@ -20,14 +22,9 @@ $PathToCUXboxGameBar = "HKCU:\Software\Microsoft\GameBar"
function Disable-ActivityHistory() { function Disable-ActivityHistory() {
Write-Status -Types "-", "Privacy" -Status "Disabling Activity History..." Write-Status -Types "-", "Privacy" -Status "Disabling Activity History..."
Set-ItemPropertyVerified -Path $PathToLMPoliciesSystem -Name "EnableActivityFeed" -Type DWord -Value 0
If (!(Test-Path "$PathToLMPoliciesSystem")) { Set-ItemPropertyVerified -Path $PathToLMPoliciesSystem -Name "PublishUserActivities" -Type DWord -Value 0
New-Item -Path "$PathToLMPoliciesSystem" -Force | Out-Null Set-ItemPropertyVerified -Path $PathToLMPoliciesSystem -Name "UploadUserActivities" -Type DWord -Value 0
}
Set-ItemProperty -Path $PathToLMPoliciesSystem -Name "EnableActivityFeed" -Type DWord -Value 0
Set-ItemProperty -Path $PathToLMPoliciesSystem -Name "PublishUserActivities" -Type DWord -Value 0
Set-ItemProperty -Path $PathToLMPoliciesSystem -Name "UploadUserActivities" -Type DWord -Value 0
} }
function Enable-ActivityHistory() { function Enable-ActivityHistory() {
@ -39,32 +36,26 @@ function Enable-ActivityHistory() {
function Disable-AutomaticWindowsUpdate() { function Disable-AutomaticWindowsUpdate() {
Write-Status -Types "-", "WU" -Status "Disabling Automatic Download and Installation of Windows Updates..." Write-Status -Types "-", "WU" -Status "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) # [@] (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) # [@] (4 = Automatically download and schedule installation, 5 = Automatic Updates is required and users can configure it)
Set-ItemProperty -Path "$PathToLMPoliciesWindowsUpdate" -Name "AUOptions" -Type DWord -Value 2 Set-ItemPropertyVerified -Path "$PathToLMPoliciesWindowsUpdate" -Name "AUOptions" -Type DWord -Value 2
} }
function Enable-AutomaticWindowsUpdate() { function Enable-AutomaticWindowsUpdate() {
Write-Status -Types "*", "WU" -Status "Enabling Automatic Download and Installation of Windows Updates..." Write-Status -Types "*", "WU" -Status "Enabling Automatic Download and Installation of Windows Updates..."
If (!(Test-Path "$PathToLMPoliciesWindowsUpdate")) { Set-ItemPropertyVerified -Path "$PathToLMPoliciesWindowsUpdate" -Name "AUOptions" -Type DWord -Value 5
New-Item -Path "$PathToLMPoliciesWindowsUpdate" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMPoliciesWindowsUpdate" -Name "AUOptions" -Type DWord -Value 5
} }
function Disable-BackgroundAppsToogle() { function Disable-BackgroundAppsToogle() {
Write-Status -Types "-", "Misc" -Status "Disabling Background Apps..." Write-Status -Types "-", "Misc" -Status "Disabling Background Apps..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Name "GlobalUserDisabled" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Name "GlobalUserDisabled" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BackgroundAppGlobalToggle" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BackgroundAppGlobalToggle" -Type DWord -Value 0
} }
function Enable-BackgroundAppsToogle() { function Enable-BackgroundAppsToogle() {
Write-Status -Types "*", "Misc" -Status "Enabling Background Apps..." Write-Status -Types "*", "Misc" -Status "Enabling Background Apps..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Name "GlobalUserDisabled" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Name "GlobalUserDisabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BackgroundAppGlobalToggle" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BackgroundAppGlobalToggle" -Type DWord -Value 1
} }
function Disable-ClipboardHistory() { function Disable-ClipboardHistory() {
@ -75,23 +66,13 @@ function Disable-ClipboardHistory() {
function Enable-ClipboardHistory() { function Enable-ClipboardHistory() {
Write-Status -Types "*", "Privacy" -Status "Enabling Clipboard History (requires reboot!)..." Write-Status -Types "*", "Privacy" -Status "Enabling Clipboard History (requires reboot!)..."
Set-ItemPropertyVerified -Path "$PathToLMPoliciesSystem" -Name "AllowClipboardHistory" -Type DWord -Value 1
If (!(Test-Path "$PathToLMPoliciesSystem")) { Set-ItemPropertyVerified -Path "$PathToCUClipboard" -Name "EnableClipboardHistory" -Type DWord -Value 1
New-Item -Path "$PathToLMPoliciesSystem" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMPoliciesSystem" -Name "AllowClipboardHistory" -Type DWord -Value 1
Set-ItemProperty -Path "$PathToCUClipboard" -Name "EnableClipboardHistory" -Type DWord -Value 1
} }
function Disable-ClipboardSyncAcrossDevice() { function Disable-ClipboardSyncAcrossDevice() {
Write-Status -Types "-", "Privacy" -Status "Disabling Clipboard across devices (must be using MS account)..." Write-Status -Types "-", "Privacy" -Status "Disabling Clipboard across devices (must be using MS account)..."
Set-ItemPropertyVerified -Path "$PathToLMPoliciesSystem" -Name "AllowCrossDeviceClipboard" -Type DWord -Value 0
If (!(Test-Path "$PathToLMPoliciesSystem")) {
New-Item -Path "$PathToLMPoliciesSystem" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMPoliciesSystem" -Name "AllowCrossDeviceClipboard" -Type DWord -Value 0
If ((Get-Item "$PathToCUClipboard").Property -contains "CloudClipboardAutomaticUpload") { If ((Get-Item "$PathToCUClipboard").Property -contains "CloudClipboardAutomaticUpload") {
Remove-ItemProperty -Path "$PathToCUClipboard" -Name "CloudClipboardAutomaticUpload" Remove-ItemProperty -Path "$PathToCUClipboard" -Name "CloudClipboardAutomaticUpload"
} }
@ -104,42 +85,37 @@ function Disable-ClipboardSyncAcrossDevice() {
function Enable-ClipboardSyncAcrossDevice() { function Enable-ClipboardSyncAcrossDevice() {
Write-Status -Types "*", "Privacy" -Status "Enabling Clipboard across devices (must be using MS account)..." Write-Status -Types "*", "Privacy" -Status "Enabling Clipboard across devices (must be using MS account)..."
Set-ItemPropertyVerified -Path "$PathToLMPoliciesSystem" -Name "AllowCrossDeviceClipboard" -Type DWord -Value 1
If (!(Test-Path "$PathToLMPoliciesSystem")) { Set-ItemPropertyVerified -Path "$PathToCUClipboard" -Name "CloudClipboardAutomaticUpload" -Type DWord -Value 1
New-Item -Path "$PathToLMPoliciesSystem" -Force | Out-Null Set-ItemPropertyVerified -Path "$PathToCUClipboard" -Name "EnableCloudClipboard " -Type DWord -Value 1
}
Set-ItemProperty -Path "$PathToLMPoliciesSystem" -Name "AllowCrossDeviceClipboard" -Type DWord -Value 1
Set-ItemProperty -Path "$PathToCUClipboard" -Name "CloudClipboardAutomaticUpload" -Type DWord -Value 1
Set-ItemProperty -Path "$PathToCUClipboard" -Name "EnableCloudClipboard " -Type DWord -Value 1
} }
function Disable-Cortana() { function Disable-Cortana() {
Write-Status -Types "-", "Privacy" -Status "Disabling Cortana..." Write-Status -Types "-", "Privacy" -Status "Disabling Cortana..."
Set-ItemProperty -Path "$PathToLMPoliciesCortana" -Name "AllowCortana" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "$PathToLMPoliciesCortana" -Name "AllowCortana" -Type DWord -Value 0
Set-ItemProperty -Path "$PathToLMPoliciesCortana" -Name "AllowCloudSearch" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "$PathToLMPoliciesCortana" -Name "AllowCloudSearch" -Type DWord -Value 0
Set-ItemProperty -Path "$PathToLMPoliciesCortana" -Name "ConnectedSearchUseWeb" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "$PathToLMPoliciesCortana" -Name "ConnectedSearchUseWeb" -Type DWord -Value 0
Set-ItemProperty -Path "$PathToLMPoliciesCortana" -Name "DisableWebSearch" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "$PathToLMPoliciesCortana" -Name "DisableWebSearch" -Type DWord -Value 1
} }
function Enable-Cortana() { function Enable-Cortana() {
Write-Status -Types "*", "Privacy" -Status "Enabling Cortana..." Write-Status -Types "*", "Privacy" -Status "Enabling Cortana..."
Set-ItemProperty -Path "$PathToLMPoliciesCortana" -Name "AllowCortana" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "$PathToLMPoliciesCortana" -Name "AllowCortana" -Type DWord -Value 1
Set-ItemProperty -Path "$PathToLMPoliciesCortana" -Name "AllowCloudSearch" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "$PathToLMPoliciesCortana" -Name "AllowCloudSearch" -Type DWord -Value 1
Set-ItemProperty -Path "$PathToLMPoliciesCortana" -Name "ConnectedSearchUseWeb" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "$PathToLMPoliciesCortana" -Name "ConnectedSearchUseWeb" -Type DWord -Value 1
Set-ItemProperty -Path "$PathToLMPoliciesCortana" -Name "DisableWebSearch" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "$PathToLMPoliciesCortana" -Name "DisableWebSearch" -Type DWord -Value 0
} }
function Disable-DarkTheme() { function Disable-DarkTheme() {
Write-Status -Types "*", "Personal" -Status "Disabling Dark Theme..." Write-Status -Types "*", "Personal" -Status "Disabling Dark Theme..."
Set-ItemProperty -Path "$PathToCUThemes" -Name "AppsUseLightTheme" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "$PathToCUThemes" -Name "AppsUseLightTheme" -Type DWord -Value 1
Set-ItemProperty -Path "$PathToCUThemes" -Name "SystemUsesLightTheme" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "$PathToCUThemes" -Name "SystemUsesLightTheme" -Type DWord -Value 1
} }
function Enable-DarkTheme() { function Enable-DarkTheme() {
Write-Status -Types "+", "Personal" -Status "Enabling Dark Theme..." Write-Status -Types "+", "Personal" -Status "Enabling Dark Theme..."
Set-ItemProperty -Path "$PathToCUThemes" -Name "AppsUseLightTheme" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "$PathToCUThemes" -Name "AppsUseLightTheme" -Type DWord -Value 0
Set-ItemProperty -Path "$PathToCUThemes" -Name "SystemUsesLightTheme" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "$PathToCUThemes" -Name "SystemUsesLightTheme" -Type DWord -Value 0
} }
function Disable-EncryptedDNS() { function Disable-EncryptedDNS() {
@ -164,7 +140,7 @@ function Enable-EncryptedDNS() {
function Disable-FastShutdownShortcut() { function Disable-FastShutdownShortcut() {
Write-Status -Types "*" -Status "Removing the shortcut to shutdown the computer on the Desktop..." -Warning Write-Status -Types "*" -Status "Removing the shortcut to shutdown the computer on the Desktop..." -Warning
Remove-Item -Path "$DesktopPath\Fast Shutdown.lnk" Remove-ItemVerified -Path "$DesktopPath\Fast Shutdown.lnk"
} }
function Enable-FastShutdownShortcut() { function Enable-FastShutdownShortcut() {
@ -197,7 +173,7 @@ function Disable-GodMode() {
"@ -ForegroundColor Cyan "@ -ForegroundColor Cyan
$DesktopPath = [Environment]::GetFolderPath("Desktop"); $DesktopPath = [Environment]::GetFolderPath("Desktop");
Remove-Item -Path "$DesktopPath\GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}" Remove-ItemVerified -Path "$DesktopPath\GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}"
} }
function Enable-GodMode() { function Enable-GodMode() {
@ -233,14 +209,14 @@ function Enable-InternetExplorer() {
function Disable-MouseNaturalScroll() { function Disable-MouseNaturalScroll() {
Get-PnpDevice -Class Mouse -PresentOnly -Status OK | ForEach-Object { Get-PnpDevice -Class Mouse -PresentOnly -Status OK | ForEach-Object {
Write-Status -Types "*" -Status "Disabling mouse natural mode on $($_.Name): $($_.DeviceID) (requires reboot!)" Write-Status -Types "*" -Status "Disabling mouse natural mode on $($_.Name): $($_.DeviceID) (requires reboot!)"
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters" -Name "FlipFlopWheel" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters" -Name "FlipFlopWheel" -Type DWord -Value 0
} }
} }
function Enable-MouseNaturalScroll() { function Enable-MouseNaturalScroll() {
Get-PnpDevice -Class Mouse -PresentOnly -Status OK | ForEach-Object { Get-PnpDevice -Class Mouse -PresentOnly -Status OK | ForEach-Object {
Write-Status -Types "+" -Status "Enabling mouse natural mode on $($_.Name): $($_.DeviceID) (requires reboot!)" Write-Status -Types "+" -Status "Enabling mouse natural mode on $($_.Name): $($_.DeviceID) (requires reboot!)"
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters" -Name "FlipFlopWheel" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters" -Name "FlipFlopWheel" -Type DWord -Value 1
} }
} }
@ -251,41 +227,33 @@ function Disable-OldVolumeControl() {
function Enable-OldVolumeControl() { function Enable-OldVolumeControl() {
Write-Status -Types "+", "Misc" -Status "Enabling Old Volume Control..." Write-Status -Types "+", "Misc" -Status "Enabling Old Volume Control..."
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\MTCUVC" -Name "EnableMtcUvc" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\MTCUVC" -Name "EnableMtcUvc" -Type DWord -Value 0
} }
function Disable-OnlineSpeechRecognition() { function Disable-OnlineSpeechRecognition() {
Write-Status -Types "-", "Privacy" -Status "Disabling Online Speech Recognition..." Write-Status -Types "-", "Privacy" -Status "Disabling Online Speech Recognition..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\InputPersonalization" -Name "AllowInputPersonalization" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Policies\Microsoft\InputPersonalization" -Name "AllowInputPersonalization" -Type DWord -Value 0
If (!(Test-Path "$PathToCUOnlineSpeech")) {
New-Item -Path "$PathToCUOnlineSpeech" -Force | Out-Null
}
# [@] (0 = Decline, 1 = Accept) # [@] (0 = Decline, 1 = Accept)
Set-ItemProperty -Path "$PathToCUOnlineSpeech" -Name "HasAccepted" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "$PathToCUOnlineSpeech" -Name "HasAccepted" -Type DWord -Value 0
} }
function Enable-OnlineSpeechRecognition() { function Enable-OnlineSpeechRecognition() {
Write-Status -Types "+", "Privacy" -Status "Enabling Online Speech Recognition..." Write-Status -Types "+", "Privacy" -Status "Enabling Online Speech Recognition..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\InputPersonalization" -Name "AllowInputPersonalization" Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\InputPersonalization" -Name "AllowInputPersonalization"
If (!(Test-Path "$PathToCUOnlineSpeech")) {
New-Item -Path "$PathToCUOnlineSpeech" -Force | Out-Null
}
# [@] (0 = Decline, 1 = Accept) # [@] (0 = Decline, 1 = Accept)
Set-ItemProperty -Path "$PathToCUOnlineSpeech" -Name "HasAccepted" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "$PathToCUOnlineSpeech" -Name "HasAccepted" -Type DWord -Value 1
} }
function Disable-PhoneLink() { function Disable-PhoneLink() {
Write-Status -Types "-", "Privacy" -Status "Disabling Phone Link (Your Phone)..." Write-Status -Types "-", "Privacy" -Status "Disabling Phone Link (Your Phone)..."
Set-ItemProperty -Path "$PathToLMPoliciesCloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "$PathToLMPoliciesCloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 1
Set-ItemProperty -Path "$PathToLMPoliciesSystem" -Name "EnableMmx" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "$PathToLMPoliciesSystem" -Name "EnableMmx" -Type DWord -Value 0
} }
function Enable-PhoneLink() { function Enable-PhoneLink() {
Write-Status -Types "*", "Privacy" -Status "Enabling Phone Link (Your Phone)..." Write-Status -Types "*", "Privacy" -Status "Enabling Phone Link (Your Phone)..."
Set-ItemProperty -Path "$PathToLMPoliciesCloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "$PathToLMPoliciesCloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 0
Set-ItemProperty -Path "$PathToLMPoliciesSystem" -Name "EnableMmx" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "$PathToLMPoliciesSystem" -Name "EnableMmx" -Type DWord -Value 1
} }
function Disable-PrintToPDFServicesToogle() { function Disable-PrintToPDFServicesToogle() {
@ -306,27 +274,21 @@ function Enable-PrintingXPSServicesToogle() {
function Disable-SearchAppForUnknownExt() { function Disable-SearchAppForUnknownExt() {
Write-Status -Types "-", "Misc" -Status "Disabling Search for App in Store for Unknown Extensions..." Write-Status -Types "-", "Misc" -Status "Disabling Search for App in Store for Unknown Extensions..."
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer")) { Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer" -Name "NoUseStoreOpenWith" -Type DWord -Value 1
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer" -Name "NoUseStoreOpenWith" -Type DWord -Value 1
} }
function Enable-SearchAppForUnknownExt() { function Enable-SearchAppForUnknownExt() {
Write-Status -Types "*", "Misc" -Status "Enabling Search for App in Store for Unknown Extensions..." Write-Status -Types "*", "Misc" -Status "Enabling Search for App in Store for Unknown Extensions..."
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer" -Force | Out-Null
}
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer" -Name "NoUseStoreOpenWith" Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer" -Name "NoUseStoreOpenWith"
} }
function Disable-Telemetry() { function Disable-Telemetry() {
Write-Status -Types "-", "Privacy" -Status "Disabling Telemetry..." Write-Status -Types "-", "Privacy" -Status "Disabling Telemetry..."
# [@] (0 = Security (Enterprise only), 1 = Basic Telemetry, 2 = Enhanced Telemetry, 3 = Full Telemetry) # [@] (0 = Security (Enterprise only), 1 = Basic Telemetry, 2 = Enhanced Telemetry, 3 = Full Telemetry)
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowDeviceNameInTelemetry" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowDeviceNameInTelemetry" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
Stop-Service "DiagTrack" -NoWait -Force Stop-Service "DiagTrack" -NoWait -Force
Set-ServiceStartup -State 'Disabled' -Services "DiagTrack" Set-ServiceStartup -State 'Disabled' -Services "DiagTrack"
@ -367,54 +329,46 @@ function Enable-WSearchService() {
function Disable-XboxGameBarDVRandMode() { function Disable-XboxGameBarDVRandMode() {
# Adapted from: https://docs.microsoft.com/en-us/answers/questions/241800/completely-disable-and-remove-xbox-apps-and-relate.html # Adapted from: https://docs.microsoft.com/en-us/answers/questions/241800/completely-disable-and-remove-xbox-apps-and-relate.html
Write-Status -Types "-", "Performance" -Status "Disabling Xbox Game Bar DVR..." Write-Status -Types "-", "Performance" -Status "Disabling Xbox Game Bar DVR..."
Set-ItemProperty -Path "$PathToLMPoliciesAppGameDVR" -Name "value" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "$PathToLMPoliciesAppGameDVR" -Name "value" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR" -Name "AppCaptureEnabled" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR" -Name "AppCaptureEnabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_Enabled" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_Enabled" -Type DWord -Value 0
If (!(Test-Path "$PathToLMPoliciesGameDVR")) { Set-ItemPropertyVerified -Path "$PathToLMPoliciesGameDVR" -Name "AllowGameDVR" -Type DWord -Value 0
New-Item -Path "$PathToLMPoliciesGameDVR" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMPoliciesGameDVR" -Name "AllowGameDVR" -Type DWord -Value 0
Set-ServiceStartup -State 'Disabled' -Services "BcastDVRUserService*" Set-ServiceStartup -State 'Disabled' -Services "BcastDVRUserService*"
Write-Status -Types "-", "Performance" -Status "Enabling Game mode..." Write-Status -Types "-", "Performance" -Status "Enabling Game mode..."
Set-ItemProperty -Path "$PathToCUXboxGameBar" -Name "AutoGameModeEnabled" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "$PathToCUXboxGameBar" -Name "AutoGameModeEnabled" -Type DWord -Value 0
Write-Status -Types "-", "Performance" -Status "Enabling Game Mode Notifications..." Write-Status -Types "-", "Performance" -Status "Enabling Game Mode Notifications..."
Set-ItemProperty -Path "$PathToCUXboxGameBar" -Name "ShowGameModeNotifications" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "$PathToCUXboxGameBar" -Name "ShowGameModeNotifications" -Type DWord -Value 0
Write-Status -Types "-", "Performance" -Status "Enabling Game Bar tips..." Write-Status -Types "-", "Performance" -Status "Enabling Game Bar tips..."
Set-ItemProperty -Path "$PathToCUXboxGameBar" -Name "ShowStartupPanel" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "$PathToCUXboxGameBar" -Name "ShowStartupPanel" -Type DWord -Value 0
Write-Status -Types "-", "Performance" -Status "Enabling Open Xbox Game Bar using Xbox button on Game Controller..." Write-Status -Types "-", "Performance" -Status "Enabling Open Xbox Game Bar using Xbox button on Game Controller..."
Set-ItemProperty -Path "$PathToCUXboxGameBar" -Name "UseNexusForGameBarEnabled" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "$PathToCUXboxGameBar" -Name "UseNexusForGameBarEnabled" -Type DWord -Value 0
Grant-RegistryPermission -Key "HKLM:\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.GameBar.PresenceServer.Internal.PresenceWriter" Grant-RegistryPermission -Key "HKLM:\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.GameBar.PresenceServer.Internal.PresenceWriter"
Write-Status -Types "-", "Performance" -Status "Disabling GameBar Presence Writer..." Write-Status -Types "-", "Performance" -Status "Disabling GameBar Presence Writer..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.GameBar.PresenceServer.Internal.PresenceWriter" -Name "ActivationType" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.GameBar.PresenceServer.Internal.PresenceWriter" -Name "ActivationType" -Type DWord -Value 0
} }
function Enable-XboxGameBarDVRandMode() { function Enable-XboxGameBarDVRandMode() {
Write-Status -Types "*", "Performance" -Status "Enabling Xbox Game Bar DVR..." Write-Status -Types "*", "Performance" -Status "Enabling Xbox Game Bar DVR..."
Write-Status -Types "*", "Performance" -Status "Removing GameDVR policies..." Write-Status -Types "*", "Performance" -Status "Removing GameDVR policies..."
If ((Test-Path "$PathToLMPoliciesAppGameDVR")) { Remove-ItemVerified -Path "$PathToLMPoliciesAppGameDVR" -Recurse
Remove-Item -Path "$PathToLMPoliciesAppGameDVR" -Recurse Set-ItemPropertyVerified -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR" -Name "AppCaptureEnabled" -Type DWord -Value 1
} Set-ItemPropertyVerified -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_Enabled" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR" -Name "AppCaptureEnabled" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_Enabled" -Type DWord -Value 1
If (!(Test-Path "$PathToLMPoliciesGameDVR")) {
New-Item -Path "$PathToLMPoliciesGameDVR" -Force | Out-Null
}
Remove-ItemProperty -Path "$PathToLMPoliciesGameDVR" -Name "AllowGameDVR" Remove-ItemProperty -Path "$PathToLMPoliciesGameDVR" -Name "AllowGameDVR"
Set-ServiceStartup -State 'Manual' -Services "BcastDVRUserService*" Set-ServiceStartup -State 'Manual' -Services "BcastDVRUserService*"
Write-Status -Types "*", "Performance" -Status "Enabling Game mode..." Write-Status -Types "*", "Performance" -Status "Enabling Game mode..."
Set-ItemProperty -Path "$PathToCUXboxGameBar" -Name "AutoGameModeEnabled" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "$PathToCUXboxGameBar" -Name "AutoGameModeEnabled" -Type DWord -Value 1
Write-Status -Types "*", "Performance" -Status "Enabling Game Mode Notifications..." Write-Status -Types "*", "Performance" -Status "Enabling Game Mode Notifications..."
Set-ItemProperty -Path "$PathToCUXboxGameBar" -Name "ShowGameModeNotifications" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "$PathToCUXboxGameBar" -Name "ShowGameModeNotifications" -Type DWord -Value 1
Write-Status -Types "*", "Performance" -Status "Enabling Game Bar tips..." Write-Status -Types "*", "Performance" -Status "Enabling Game Bar tips..."
Set-ItemProperty -Path "$PathToCUXboxGameBar" -Name "ShowStartupPanel" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "$PathToCUXboxGameBar" -Name "ShowStartupPanel" -Type DWord -Value 1
Write-Status -Types "*", "Performance" -Status "Enabling Open Xbox Game Bar using Xbox button on Game Controller..." Write-Status -Types "*", "Performance" -Status "Enabling Open Xbox Game Bar using Xbox button on Game Controller..."
Set-ItemProperty -Path "$PathToCUXboxGameBar" -Name "UseNexusForGameBarEnabled" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "$PathToCUXboxGameBar" -Name "UseNexusForGameBarEnabled" -Type DWord -Value 1
Grant-RegistryPermission -Key "HKLM:\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.GameBar.PresenceServer.Internal.PresenceWriter" Grant-RegistryPermission -Key "HKLM:\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.GameBar.PresenceServer.Internal.PresenceWriter"
Write-Status -Types "*", "Performance" -Status "Enabling GameBar Presence Writer..." Write-Status -Types "*", "Performance" -Status "Enabling GameBar Presence Writer..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.GameBar.PresenceServer.Internal.PresenceWriter" -Name "ActivationType" -Type DWord -Value 1 Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.GameBar.PresenceServer.Internal.PresenceWriter" -Name "ActivationType" -Type DWord -Value 1
} }

@ -1,5 +1,6 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"manage-software.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"manage-software.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\debloat-helper\"set-item-property-verified.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\utils\"individual-tweaks.psm1" Import-Module -DisableNameChecking $PSScriptRoot\..\utils\"individual-tweaks.psm1"
function Install-Cortana() { function Install-Cortana() {
@ -28,7 +29,7 @@ function Install-MicrosoftEdge() {
function Install-OneDrive() { function Install-OneDrive() {
Write-Status -Types "*" -Status "Installing OneDrive..." Write-Status -Types "*" -Status "Installing OneDrive..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" -Type DWord -Value 0 Set-ItemPropertyVerified -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" -Type DWord -Value 0
Start-Process -FilePath "$env:SystemRoot\SysWOW64\OneDriveSetup.exe" Start-Process -FilePath "$env:SystemRoot\SysWOW64\OneDriveSetup.exe"
} }
@ -86,10 +87,7 @@ function Install-Xbox() {
Install-Software -Name "Missing Xbox Apps" -Packages $XboxApps -ViaMSStore -NoDialog Install-Software -Name "Missing Xbox Apps" -Packages $XboxApps -ViaMSStore -NoDialog
Write-Status -Types "*", $TweakType -Status "Enabling Xbox Game Monitoring..." Write-Status -Types "*", $TweakType -Status "Enabling Xbox Game Monitoring..."
If (!(Test-Path "$PathToLMServicesXbgm")) { Set-ItemPropertyVerified -Path "$PathToLMServicesXbgm" -Name "Start" -Type DWord -Value 3
New-Item -Path "$PathToLMServicesXbgm" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMServicesXbgm" -Name "Start" -Type DWord -Value 3
Enable-XboxGameBarDVRandMode Enable-XboxGameBarDVRandMode
} }

Loading…
Cancel
Save