Skip to content

Instantly share code, notes, and snippets.

@NathanTheGr8
Last active March 7, 2017 21:41
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 NathanTheGr8/d1f0c6fa2a01a7c4008f62fc54f4bcc6 to your computer and use it in GitHub Desktop.
Save NathanTheGr8/d1f0c6fa2a01a7c4008f62fc54f4bcc6 to your computer and use it in GitHub Desktop.
##Add extension reg
$chromepath32 = "HKLM:\Software\Google\Chrome\Extensions"
$chromepath64 = "HKLM:\Software\Wow6432Node\Google\Chrome\Extensions"
$extension_id = "haiffjcadagjlijoggckpgfnoeiflnem"
if ($is64bit) {
if (-not(Test-Path "HKLM:\Software\Wow6432Node\Google")){
New-Item "HKLM:\Software\Wow6432Node" -Name "Google"
}
if (-not(Test-Path "HKLM:\Software\Wow6432Node\Google\Chrome")){
New-Item "HKLM:\Software\Wow6432Node\Google" -Name "Chrome"
}
if (-not(Test-Path "HKLM:\Software\Wow6432Node\Google\Chrome\Extensions")){
New-Item "HKLM:\Software\Wow6432Node\Google\Chrome" -Name "Extensions"
}
if (-not(Test-Path $chromepath64\$extension_id)){
New-Item $chromepath64 -Name $extension_id
}
Set-Location "$chromepath64\$extension_id"
New-ItemProperty -Path . -Name "update_url" -Value "https://clients2.google.com/service/update2/crx" -Force | Out-Null
}
else {
if (-not(Test-Path "HKLM:\Software\Google")){
New-Item "HKLM:\Software" -Name "Google"
}
if (-not(Test-Path "HKLM:\Software\Google\Chrome")){
New-Item "HKLM:\Software\Google" -Name "Chrome"
}
if (-not(Test-Path "HKLM:\Software\Google\Chrome\Extensions")){
New-Item "HKLM:\Software\Google\Chrome" -Name "Extensions"
}
if (-not(Test-Path $chromepath32\$extension_id)){
New-Item $chromepath32 -Name $extension_id
}
Set-Location "$chromepath32\$extension_id"
New-ItemProperty -Path . -Name "update_url" -Value "https://clients2.google.com/service/update2/crx" -Force | Out-Null
}
@NathanTheGr8
Copy link
Author

Learn how to get extension id and update_url at https://developer.chrome.com/extensions/external_extensions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment