lib/.playwright/package/bin/reinstall_msedge_beta_win.ps1
$ErrorActionPreference = 'Stop' $url = $args[0] Microsoft.PowerShell.Utility\Write-Host "Downloading Microsoft Edge Beta" $wc = Microsoft.PowerShell.Utility\New-Object net.webclient $msiInstaller = "$env:temp\microsoft-edge-beta.msi" $wc.Downloadfile($url, $msiInstaller) Microsoft.PowerShell.Utility\Write-Host "Installing Microsoft Edge Beta" $arguments = "/i `"$msiInstaller`" /quiet" Microsoft.PowerShell.Management\Start-Process msiexec.exe -ArgumentList $arguments -Wait Microsoft.PowerShell.Management\Remove-Item $msiInstaller $suffix = "\\Microsoft\\Edge Beta\\Application\\msedge.exe" if (Microsoft.PowerShell.Management\Test-Path "${env:ProgramFiles(x86)}$suffix") { (Microsoft.PowerShell.Management\Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo } elseif (Microsoft.PowerShell.Management\Test-Path "${env:ProgramFiles}$suffix") { (Microsoft.PowerShell.Management\Get-Item "${env:ProgramFiles}$suffix").VersionInfo } else { Microsoft.PowerShell.Utility\Write-Host "ERROR: Failed to install Microsoft Edge Beta." Microsoft.PowerShell.Utility\Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help." exit 1 } |