获取Edge最新官方离线安装包下载地址

By | 2022-12-18

将下面的powershell脚本复制到powershell窗口运行

或者粘贴到记事本另存为扩展名ps1的文件,然后右键powershell运行即可获得最新版Edge离线包的下载地址

其次下载的exe文件重命名为.7z文件即可解压出绿色文件
Out-File $env:temp\edge.txt
foreach ($channel in "stable", "beta", "dev", "canary")
{
    foreach ($platform in "x64", "x86")
    {
        $version = (Invoke-RestMethod -Uri https://msedge.api.cdp.microsoft.com/api/v1.1/contents/Browser/namespaces/Default/names/msedge-$channel-win-$platform/versions/latest?action=select -Method POST -Body targetingAttributes).ContentId.Version
        $url =  Invoke-RestMethod -Uri "https://msedge.api.cdp.microsoft.com/api/v1.1/internal/contents/Browser/namespaces/Default/names/msedge-$channel-win-$platform/versions/$version/files?action=GenerateDownloadInfo&foregroundPriority=true" -Method POST
        $title = "Microsoft Edge $channel win $platform" | Out-File $env:temp\edge.txt -Append
        ($url | sort SizeInBytes | Select-Object FileId -Last 1).FileId | Out-File $env:temp\edge.txt -Append
        ($url | sort SizeInBytes | Select-Object url -Last 1).url | Out-File $env:temp\edge.txt -Append
        "" | Out-File $env:temp\edge.txt -Append
    }
}
notepad.exe $env:temp\edge.txt