Better output for registery modifications
This commit is contained in:
parent
e72b3347d7
commit
539c0aeae3
1 changed files with 20 additions and 16 deletions
36
cleanW10.ps1
36
cleanW10.ps1
|
@ -87,9 +87,9 @@ function remove_shitty_tasks () {
|
||||||
# value : The value to write
|
# value : The value to write
|
||||||
function modify_shitty_reg_value {
|
function modify_shitty_reg_value {
|
||||||
param([string]$path, [string]$key, [string]$value, [string]$type)
|
param([string]$path, [string]$key, [string]$value, [string]$type)
|
||||||
Write-Host -ForegroundColor white -NoNewline "Modify $key reg value to $value : "
|
Write-Host -NoNewline "`t$key reg key to $value : "
|
||||||
if (!(Test-Path $path)){
|
if (!(Test-Path $path)){
|
||||||
Write-Host -ForegroundColor Gray -NoNewline "creating path - "
|
Write-Host -ForegroundColor Gray -NoNewline "creating path "
|
||||||
New-Item -Path $path -Force | Out-Null
|
New-Item -Path $path -Force | Out-Null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ function modify_shitty_reg_value {
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Write-Host -ForegroundColor Red "error"
|
Write-Host -ForegroundColor Red "error"
|
||||||
Write-Host $Error[0]
|
Write-Host "`t$Error[0]"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
Write-host -ForegroundColor Green "done"
|
Write-host -ForegroundColor Green "done"
|
||||||
|
@ -246,45 +246,47 @@ Remove-PSDrive -Name HKCR
|
||||||
Start-Process "explorer.exe"
|
Start-Process "explorer.exe"
|
||||||
|
|
||||||
#Advertiging...
|
#Advertiging...
|
||||||
|
Write-Host -ForegroundColor White "Disable Advertising :"
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\AdvertisingInfo" "Enabled" "0"
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\AdvertisingInfo" "Enabled" "0"
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" "DisabledByGroupPolicy" 1
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" "DisabledByGroupPolicy" 1
|
||||||
|
|
||||||
# Geoloc.
|
# Geoloc.
|
||||||
|
Write-Host -ForegroundColor White "Disable Geolocalization :"
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" "DisableLocation" 1
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" "DisableLocation" 1
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" "DisableLocationScripting" 1
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" "DisableLocationScripting" 1
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" "DisableWindowsLocationProvider" 1
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" "DisableWindowsLocationProvider" 1
|
||||||
|
|
||||||
#smartscreen filter
|
#smartscreen filter
|
||||||
|
Write-Host -ForegroundColor White "Disable Smartscreen filter :"
|
||||||
modify_shitty_reg_value "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" "EnableWebContentEvaluation"
|
modify_shitty_reg_value "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" "EnableWebContentEvaluation"
|
||||||
|
|
||||||
# AllowTelemetry
|
# AllowTelemetry
|
||||||
|
Write-Host -ForegroundColor White "Disable Telemetry :"
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" "AllowTelemetry" 0
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" "AllowTelemetry" 0
|
||||||
|
|
||||||
|
Write-Host -ForegroundColor White "Modify somes Windows defendenr behaviors :"
|
||||||
# Windows Defender Delivery Optimization Download
|
# Windows Defender Delivery Optimization Download
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" "DODownloadMode" "0"
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" "DODownloadMode" "0"
|
||||||
|
|
||||||
# WifiSense Credential Share
|
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" "WiFiSenseCredShared" "0"
|
|
||||||
|
|
||||||
# WifiSense Open-ness
|
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" "WiFiSenseOpen" "0"
|
|
||||||
|
|
||||||
# Windows Defender Spynet
|
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" "SpynetReporting" 0
|
|
||||||
|
|
||||||
# Windows Defender Sample Submission
|
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" "SubmitSamplesConsent" 2
|
|
||||||
|
|
||||||
# Windows Defender Behavior monitoring and Spynet reporting.
|
# Windows Defender Behavior monitoring and Spynet reporting.
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" "DisableBehaviorMonitoring" 1
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" "DisableBehaviorMonitoring" 1
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" "SpynetReporting" 0
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" "SpynetReporting" 0
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" "SubmitSamplesConsent" 2
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" "SubmitSamplesConsent" 2
|
||||||
|
|
||||||
|
|
||||||
|
Write-Host -ForegroundColor White "Disable Wifi-Sense :"
|
||||||
|
# WifiSense Credential Share
|
||||||
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" "WiFiSenseCredShared" "0"
|
||||||
|
# WifiSense Open-ness
|
||||||
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" "WiFiSenseOpen" "0"
|
||||||
|
|
||||||
|
|
||||||
# Disable Cortana
|
# Disable Cortana
|
||||||
|
Write-Host -ForegroundColor White "Disable Cortana (online at least) :"
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\" "AllowCortana" "0"
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\" "AllowCortana" "0"
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\" "ConnectedSearchUseWeb" "0"
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\" "ConnectedSearchUseWeb" "0"
|
||||||
|
|
||||||
# App right.
|
# App right.
|
||||||
|
Write-Host -ForegroundColor White "Disable rights for applications :"
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" "LetAppsAccessAccountInfo" 2
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" "LetAppsAccessAccountInfo" 2
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" "LetAppsAccessCalendar" 2
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" "LetAppsAccessCalendar" 2
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" "LetAppsAccessCallHistory" 2
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" "LetAppsAccessCallHistory" 2
|
||||||
|
@ -300,9 +302,11 @@ modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" "
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" "LetAppsSyncWithDevices" 2
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" "LetAppsSyncWithDevices" 2
|
||||||
|
|
||||||
# MS Account
|
# MS Account
|
||||||
|
Write-Host -ForegroundColor White "Disable MS online account for login :"
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" "NoConnectedUser" 3
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" "NoConnectedUser" 3
|
||||||
|
|
||||||
# App suggestion (Cloud Content)
|
# App suggestion (Cloud Content)
|
||||||
|
Write-Host -ForegroundColor White "Disable suggestions :"
|
||||||
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Cloud Content" "DisableWindowsConsumerFeatures" 1
|
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Cloud Content" "DisableWindowsConsumerFeatures" 1
|
||||||
|
|
||||||
Write-Host "all done!"
|
Write-Host "all done!"
|
||||||
|
|
Reference in a new issue