Skip to main content

Chromium Browsers - Extension - Install

Summary

Install Extensions on Popular Chromium Browsers ('Chrome', 'Edge', 'Brave', 'Vivaldi', 'Chromium').

Sample Run

Sample Run 1
Sample Run 2
Sample Run 3

Dependencies

Register-ChromiumExtension

User Parameters

NameExampleRequiredDescription
ExtensionIDnakcddgmfmjmdbfahkkiijejmmfkfipcTrueThe ExtensionID of the Extension(s) from the Google Chrome Store. Multiple IDs can be separated by a comma. Example: `'kgjfgplpablkjnlkjmjdecgdpfankdle', 'cjpalhdlnbpafiamejdnhcphjbkeiagm'
TargetChromeFalseDesignates the target browser to add the extension to. Defaults to applying settings to all available targets. Available Options: 'Chrome', 'Edge', 'Brave', 'Vivaldi', 'Chromium'. Multiple IDs can be separated by a comma: 'Chrome', 'Edge', 'Brave'

Task Creation

Create a new Script Editor style script in the system to implement this Task.
Task Creation Image 1
Task Creation Image 2

Name: Chromium Browsers - Extension - Install
Description: Install Extensions on Popular Chromium Browsers ('Chrome', 'Edge', 'Brave', 'Vivaldi', 'Chromium')
Category: Application
Task Creation Image 3

Parameters

Add a new parameter by clicking the Add Parameter button present at the top-right corner of the screen.
Parameter Image 1

This screen will appear.
Parameter Image 2

  • Set ExtensionID in the Parameter Name field.
  • Enable the Required Field option.
  • Select Text String from the Parameter Type dropdown menu.
  • Click the Save button.
    Parameter Image 3
  • It will ask for confirmation to proceed. Click the Confirm button to create the parameter.
    Parameter Image 4

Add another parameter by clicking the Add Parameter button present at the top-right corner of the screen.
Parameter Image 5

This screen will appear.
Parameter Image 6

  • Set Target in the Parameter Name field.
  • Select Text String from the Parameter Type dropdown menu.
  • Click the Save button.
    Parameter Image 7
  • It will ask for confirmation to proceed. Click the Confirm button to create the parameter.
    Parameter Image 8

Task

Navigate to the Script Editor Section and start by adding a row. You can do this by clicking the Add Row button at the bottom of the script page.
Task Image 1

A blank function will appear.
Task Image 2

Row 1 Function: PowerShell Script

Search and select the PowerShell Script function.
Task Image 3
Task Image 4

The following function will pop up on the screen:
Task Image 5

Paste in the following PowerShell script and set the expected time of script execution to 900 seconds. Click the Save button.

$ExtensionID = "@ExtensionID@"
$Target = "@Target@"
$ProjectName = 'Register-ChromiumExtension'
$WorkingDirectory = "C:\ProgramData\_Automation\Script\$ProjectName"
$ScriptPath = "$WorkingDirectory\$ProjectName.ps1"
$BaseURL = 'https://file.provaltech.com/repo'
$PS1URL = "$BaseURL/Script/$ProjectName.ps1"
$LogPath = "$WorkingDirectory\$ProjectName-log.txt"
$ErrorLogPath = "$WorkingDirectory\$ProjectName-Error.txt"
[Net.ServicePointManager]::SecurityProtocol = [Enum]::ToObject([Net.SecurityProtocolType], 3072)
Remove-Item $WorkingDirectory -Force -Recurse -ErrorAction SilentlyContinue | Out-Null
Mkdir $WorkingDirectory 3>&1 2>&1 1>$Null
try {(New-Object System.Net.WebClient).DownloadFile($PS1URL, $ScriptPath)} catch {throw 'Script Download Failure'}
if ( $Target -match '^(Chromium|Chrome|Edge|Brave|Vivaldi)$' ) {
& $ScriptPath -ExtensionID $ExtensionID -Target $Target
} else {
& $ScriptPath -ExtensionID $ExtensionID
}
if ( !(Test-Path $LogPath) ) {
Throw 'PowerShell Failure. A Security application seems to have restricted the execution of the PowerShell Script.'
}
if ( Test-Path $ErrorLogPath ) {
$ErrorContent = ( Get-Content -Path $ErrorLogPath )
throw $ErrorContent
}
Get-Content -Path $LogPath

Task Image 6

Click the Save button at the top-right corner of the screen to save the script.
Task Image 7

Completed Task

Completed Task Image

Output

  • Script Log