diff --git a/scripts/disable-telemetry.ps1 b/scripts/disable-telemetry.ps1 index 53ce861..0fe45fa 100644 --- a/scripts/disable-telemetry.ps1 +++ b/scripts/disable-telemetry.ps1 @@ -3,8 +3,6 @@ # hosts file. Hard coded telemetry related IPs are blocked by Windows firewall. # Additionally telemetry is disallows via Group Policies. -Import-Module -DisableNameChecking $PSScriptRoot\..\lib\reg-helper.psm1 - echo "Adding telemetry domains to hosts file" $hosts = cat "$PSScriptRoot\..\res\telemetry-hosts.txt" $hosts_file = "$env:systemroot\System32\drivers\etc\hosts" @@ -29,7 +27,5 @@ New-NetFirewallRule -DisplayName "Block Telemetry IPs" -Direction Outbound ` -Action Block -RemoteAddress ([string[]]$ips) echo "Disabling telemetry via Group Policies" -Import-Registry(@" -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection] -"AllowTelemetry"=dword:00000000 -"@) +mkdir -Force "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" +sp "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" "AllowTelemetry" 0