Skip to content

Instantly share code, notes, and snippets.

@poshcodebear
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poshcodebear/e93cb8905d93bd21485f to your computer and use it in GitHub Desktop.
Save poshcodebear/e93cb8905d93bd21485f to your computer and use it in GitHub Desktop.
Block updates to Internet Explorer
$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