From f5b2e479c306b3993cd62489b28378f283423e9e Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Sat, 22 Aug 2015 18:29:47 +0200 Subject: [PATCH] remove reg-import from disable telemetry --- scripts/disable-telemetry.ps1 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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