Last active
August 29, 2015 14:26
-
-
Save poshcodebear/e93cb8905d93bd21485f to your computer and use it in GitHub Desktop.
Block updates to Internet Explorer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Setup = 'HKLM:\SOFTWARE\Microsoft\Internet Explorer\Setup' | |
$Main = 'HKLM:\SOFTWARE\Microsoft\Internet Explorer\Main' | |
$Versions = '9', '10', '11' | |
#Disable upgrading to Versions listed above | |
try { Get-Item -Path $Setup -ErrorAction Stop } | |
catch { New-Item -Path $Setup } | |
foreach ($ver in $Versions) { | |
if ([int]$ver -lt 10) { $dna = $ver + '0' } | |
else { $dna = $ver } | |
$Path = "$Setup\$ver.0" | |
$Prop = "DoNotAllowIE$dna" | |
$Type = 'DWord' | |
$Value = '00000001' | |
try { Get-Item -Path $Path -ErrorAction Stop } | |
catch { New-Item -Path $Path } | |
try { | |
New-ItemProperty -Path $Path ` | |
-Name $Prop ` | |
-PropertyType $Type ` | |
-Value $Value ` | |
-ErrorAction Stop | |
} | |
catch { | |
Set-ItemProperty -Path $Path ` | |
-Name $Prop ` | |
-Value $Value | |
} | |
} | |
#Turn off auto install updates in IE 10 + | |
$Path = "$Main" | |
$Prop = 'EnableAutoUpgrade' | |
$Type = 'DWord' | |
$Value = '00000000' | |
try { | |
New-ItemProperty -Path $Path ` | |
-Name $Prop ` | |
-PropertyType $Type ` | |
-Value $Value ` | |
-ErrorAction Stop | |
} | |
catch { | |
Set-ItemProperty -Path $Path ` | |
-Name $Prop ` | |
-Value $Value | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment