<# .SYNOPSIS PowerShell script to get infomation of Microsoft Edge for Enterprise for Windows from Download Site (https://www.microsoft.com/en-us/edge/business/download) . .DESCRIPTION This script use Microsoft Edge for Enterprise download site source page, and get available udpates information. .INPUTS The script takes Architecture (x86/x64/arm64) .OUTPUTS return table .EXAMPLE # Get download info of Microsoft Edge Stable current version for Windows x64, x86 and arm64 .\get-msedgebizwin.ps1 .EXAMPLE # Get download info of Microsoft Edge Stable current version for Windows x64 , and download it. $result = .\ get-msedgebizwin.ps1 -Architecture "x64" $downloadurl = $result.Url $filename = $result.FileName curl.exe -L --fail --retry 3 --retry-delay 2 -o (Join-Path $env:userprofile\downloads $filename) $downloadurl or $ProgressPreference = 'SilentlyContinue' ; Invoke-WebRequest -Uri$downloadurl -OutFile (Join-Path $env:userprofile\downloads $filename) ; $ProgressPreference = 'Continue' .NOTES This script is a sample. Use it at your own risk. #> param ( [string]$Architecture = "*" #x64|x86|arm64|*(default) ) $ret = Invoke-WebRequest -uri "https://www.microsoft.com/en-us/edge/business/download" if ($ret.StatusCode -ne 200) { Write-Host "Error: HTTP Error" return } $html = $ret.Content $pattern = '"(?\d+\.\d+\.\d+\.\d+)"\s*,\s*"(?https:[^"]*MicrosoftEdgePolicyTemplates\.cab)"' $vers = [regex]::Matches($html, $pattern)| ForEach-Object { [pscustomobject]@{ Version = "$($_.Groups['version'].Value)" Url = $_.Groups['url'].Value } } $currentver = ($vers | Select-Object -First 1).Version $pattern = '"windows-(?x64|x86|arm64)"\s*,\s*"(?https:[^"]+?\.msi)"' $urls = [regex]::Matches($html, $pattern) | ForEach-Object { [pscustomobject]@{ Version = $currentver Architecture = $_.Groups['arch'].Value FileName = (Split-Path ($_.Groups['url'].Value) -Leaf) Url = $_.Groups['url'].Value } } $urls | Where { $_.Architecture -like $Architecture }