Better output for registery modifications

This commit is contained in:
Yorick Barbanneau 2018-02-22 12:16:21 +01:00
parent e72b3347d7
commit 539c0aeae3

View file

@ -87,9 +87,9 @@ function remove_shitty_tasks () {
# value : The value to write
function modify_shitty_reg_value {
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)){
Write-Host -ForegroundColor Gray -NoNewline "creating path - "
Write-Host -ForegroundColor Gray -NoNewline "creating path "
New-Item -Path $path -Force | Out-Null
}
@ -107,7 +107,7 @@ function modify_shitty_reg_value {
}
catch {
Write-Host -ForegroundColor Red "error"
Write-Host $Error[0]
Write-Host "`t$Error[0]"
return
}
Write-host -ForegroundColor Green "done"
@ -246,45 +246,47 @@ Remove-PSDrive -Name HKCR
Start-Process "explorer.exe"
#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\Policies\Microsoft\Windows\AdvertisingInfo" "DisabledByGroupPolicy" 1
# 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" "DisableLocationScripting" 1
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" "DisableWindowsLocationProvider" 1
#smartscreen filter
Write-Host -ForegroundColor White "Disable Smartscreen filter :"
modify_shitty_reg_value "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" "EnableWebContentEvaluation"
# AllowTelemetry
Write-Host -ForegroundColor White "Disable Telemetry :"
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
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.
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" "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
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\" "ConnectedSearchUseWeb" "0"
# 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" "LetAppsAccessCalendar" 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
# 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
# App suggestion (Cloud Content)
Write-Host -ForegroundColor White "Disable suggestions :"
modify_shitty_reg_value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Cloud Content" "DisableWindowsConsumerFeatures" 1
Write-Host "all done!"