Skip to content

PowerShell functions to manage browser extensions in Chrome and Edge.

License

Notifications You must be signed in to change notification settings

asheroto/Manage-Browser-Extensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

GitHub Sponsor Ko-Fi Button

Extension Management for Chrome and Edge

This script provides administrators with PowerShell functions to manage browser extensions in Chrome and Edge. Several other Chromium-based browsers honor the Chrome registry keys for extensions.

Note

Firefox is not supported.

Features

  • Install Extensions: Adds specified extensions to the registry with an optional update URL, allowing installation in the browser.
  • Remove Specified Extensions: Deletes a specified extension from the browser by removing associated registry entries.
  • Force-Install Extensions: Enforces installation of specified extensions by adding them to the ForceInstall policy list in the registry.
  • Remove Force-Installed Extensions: Removes specified extensions from the ForceInstall policy list, undoing enforced installations.
  • Block Extensions: Prevents installation of specified extensions by adding them to the registry blocklist.
  • Unblock Extensions: Allows installation of specified extensions if previously blocked by removing them from the blocklist.

How it Works

These functions make use of Windows registry keys for extension management. No files are modified.

Requirements

  • Administrator Privileges: This script modifies registry entries under HKLM (HKEY_LOCAL_MACHINE), which requires administrative rights.

Installation

Clone or download this repository to your local machine:

git clone https://github.com/asheroto/Manage-Browser-Extensions
cd Manage-Browser-Extensions

or save the raw script file.

Usage

Dot-source the functions:

. .\Manage-Browser-Extensions.ps1

This command loads the script and makes all functions available for use in the current session.

You can then call the functions provided in the script as needed.

Commands

Command Description Parameters
Install-Extension Installs an extension with an optional update URL. -Browser, -ExtensionID, -UpdateUrl
Remove-Extension Removes a specified extension from the browser. -Browser, -ExtensionID
Force-InstallExtension Forces the installation of an extension. Requires a browser restart to apply changes. -Browser, -ExtensionID
Force-RemoveExtension Removes a force-installed extension. Requires a browser restart to apply changes.. -Browser, -ExtensionID
Block-Extension Blocks a specified extension to prevent installation. -Browser, -ExtensionID
Unblock-Extension Unblocks a specified extension to allow installation. -Browser, -ExtensionID

Parameters

Parameter Required Description
-Browser Yes Specifies the browser to apply the action to (e.g., "Chrome" or "Edge").
-ExtensionID Yes The unique ID of the extension to manage (install, block, unblock, or remove).
-UpdateUrl No Install-Extension only: URL for the extension's update manifest.

Examples

Install an extension in Chrome with a default update URL:

Install-Extension -Browser "Chrome" -ExtensionID "efaidnbmnnnibpcajpcglclefindmkaj"

Remove an extension from Edge:

Remove-Extension -Browser "Edge" -ExtensionID "elhekieabhbkpmcefcoobjddigjcaadp"

Force-install an extension in Chrome:

Force-InstallExtension -Browser "Chrome" -ExtensionID "efaidnbmnnnibpcajpcglclefindmkaj"

Remove a force-installed extension from Edge:

Force-RemoveExtension -Browser "Edge" -ExtensionID "elhekieabhbkpmcefcoobjddigjcaadp"

Block an extension in Chrome:

Block-Extension -Browser "Chrome" -ExtensionID "efaidnbmnnnibpcajpcglclefindmkaj"

Unblock an extension in Edge:

Unblock-Extension -Browser "Edge" -ExtensionID "elhekieabhbkpmcefcoobjddigjcaadp"