Using PowerShell to download Edge Chromium for Business

In Microsoft Endpoint Configuration Manager you can create an Edge Application using a Wizard that will download the latest (or a specific) version.

Here there is also an option to select that once the browser is installed that it will auto update itself. However once this package is created it will always install the version that was chosen and "latest" only means the latest version at time of creation.

So once created it will download two files to the path that was choosen during the wizard. The MSI file for Edge Chromium and a PowerShell file that will handle the installation.

So what does this mean and it is a problem? Well not really, if it is allowed to auto update it will update itself as soon as it is deployed or if allow auto update isn't selected but updates are available via WSUS/CM it will eventually get to that version. However since applications tend to have security fixes and bugfixes it can be a good idea to keep the source Application somewhat up to date as well.

Of course there is always the option to manually download the latest file from https://www.microsoft.com/en-us/edge/business/download and then manually replace and update the Edge Application. But since ConfigMgr seemed to have an automated way of identifying the latest version and downloading it I though that there must be a way to replicate this with PowerShell.

First I needed to figure out from where ConfigMgr got the file. Trying a common search engine failed this time so decided to fire up Fiddler in my LAB to see what URL:s ConfigMgr was talking with.

Turns out it talked to a site called:

https://edgeupdates.microsoft.com/api/products?view=enterprise

Bingo! That was what I was looking for, searching for that URL instead gave a hit here:

https://docs.microsoft.com/en-us/mem/configmgr/apps/deploy-use/deploy-edge

There it states that the above URL must be allowed which is good since that means it will likely not be changed or removed in the near future.

Using PowerShell and Invoke-WebRequest on https://edgeupdates.microsoft.com/api/products?view=enterprise

will get a JSON response that can be used to figure out what channels and which versions are available.

So I created a sample PowerShell script that can be used to download either a specific version of a channel or the latest available version. This script only downloads the Edge MSI to for the specified channel but can easily be extended to also update your Edge application in ConfigMgr.

The script can be found here:

https://github.com/matbe/PowerShell/blob/master/Other/Get-EdgeEnterpriseMSI.ps1

Available parameters:

  • Channel (Mandatory)
    • Channel to download, Valid Options are: Dev, Beta, Stable, EdgeUpdate, Policy.
  • Folder (Mandatory)
    • Where the file will be downloaded to
  • Platform
    • Platform to download, Valid Options are: Windows or MacOS, if using channel "Policy" this should be set to "any"
      Defaults to Windows if not set.
  • Architecture
    • Architecture to download, Valid Options are: x86, x64, arm64, if using channel "Policy" this should be set to "any"
      Defaults to x64 if not set.
  • Version
    • If set the script will try and download a specific version. If not set it will download the latest.
  • Force
    • Overwrites the file without asking.

Example:

Downloads the Beta MSI into D:\Temp and overwrites any previous file already there.

.\Get-EdgeEnterpriseMSI.ps1 -Channel Beta -Folder D:\temp -Force

Downloads a specific version (if available) of the stable channel and will prompt for overwrite.

.\Get-EdgeEnterpriseMSI.ps1 -Channel Stable -Folder D:\temp -Version 82.1.2.54

Hope someone finds this usefull!

/Matt
Twitter: matbg

About the author

Mattias Benninge

5 4 votes
Article Rating
Subscribe
Notify of
guest
13 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Steven D
Steven D
13 days ago

Hi,

Thank you for the script it works like a charm.
Did you test it from Intune win32 app or Powershell Script ?

I made some customizations to only choose the ProductVersion
The script works on my local machine by running :
Powershell -ExecutionPolicy ByPass -File Install-EdgeEnterprise.ps1 -ProductVersion 119.0.2151.58

But the same command does not work from Intune..

Thank you

Johan Arwidmark
Admin
3 days ago
Reply to  Steven D

I have not. Did you try running it as System since that's how Intune runs the script?

Frank Visser
7 months ago

Hi,

I'm looking for the URL for the Edge Webview2 runtime. Do you think you can capture that one with Fiddler from MECM?

Andrew Johnson
Editor
7 months ago
Reply to  Frank Visser

Hi, Frank. Does this link help? There are several options for downloading the runtime at the bottom of the page. https://developer.microsoft.com/en-us/microsoft-edge/webview2/

Manju
Manju
2 years ago

Hi,
When i ran the script ,I am getting the below error
Unable to get http status code 200 from https://edgeupdates.microsoft.com/api/prodcuts?view=enterprize.Does the URL still exist?

Michal Zyzak
Michal Zyzak
2 years ago

Hello

I'm trying to use your tool to automate even more. I want to download the MSI and automatically create SCCM application.
However I can't find a way to get ProductID which is needed for software detection rule in DistributionType.
That information is not published on https://edgeupdates.microsoft.com/api/products?view=enterprise

For example: Edge Beta 89.0.774.23
MSi file prodct ID is: {CEC6980D-7082-4451-AE81-E1D2EB741C96}
Detection Rule is checking: HKLM\SOFTWARE\Wow6432Node\Microsoft\EdgeUpdate\Clients\{2cd8a007-e189-409d-a2c8-9af4ef3c72aa}

julian
julian
3 years ago

Nice to see you using fiddler to get the answers you need… They always seem to be 1 layer deeper, but that is the joy in what we do, the hunt 😉

Johan Arwidmark
Admin
2 years ago
Reply to  julian

Indeed 🙂

Michael McCool
Michael McCool
3 years ago

I found this extremely useful today. I was able to take your discovery work and script and turn it into a stand-alone updater/installer that we can deploy from our RMM to automatically install the latest version of Microsoft Edge to our managed systems.

For some sadistic reason, I tried to make your functionality PS 2.0 compatible. I was successful, but never really want to use 2.0 again now. So many issues and "missing" functionality.

Marvin Green
Marvin Green
3 years ago

Nice work!

Patrick Zovistoski
Patrick Zovistoski
3 years ago

This is great!
Would you consider modifying it to save the downloads in subfolders named after the channel and version? Such as:

New-Item -Path "$Folder\$Channel" -ItemType Directory -Force | out-null
New-Item -Path "$Folder\$Channel\$SelectedVersion" -ItemType Directory -Force | out-null
$Folder = "$Folder\$Channel\$SelectedVersion"


>