Open Powershell ISE and Administrator
Run the following script
# Repair-WebView2.ps1
# Run in Windows PowerShell as Administrator
$ErrorActionPreference = 'Stop'
$regPath = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView'
$nativeRegPath = 'HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView'
$backupDir = Join-Path $env:ProgramData 'WebView2Repair'
$backupFile = Join-Path $backupDir ("WebView2-{0}.reg" -f (Get-Date -Format 'yyyyMMdd-HHmmss'))
# Verify elevation
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = [Security.Principal.WindowsPrincipal]::new($identity)
if (-not $principal.IsInRole(
[Security.Principal.WindowsBuiltInRole]::Administrator
)) {
throw 'Run PowerShell as Administrator.'
}
if (-not (Test-Path $regPath)) {
throw "WebView2 uninstall registry key not found: $regPath"
}
New-Item -Path $backupDir -ItemType Directory -Force | Out-Null
# Back up registry key
& reg.exe export $nativeRegPath $backupFile /y | Out-Null
if ($LASTEXITCODE -ne 0) {
throw 'Registry backup failed. No changes made.'
}
Write-Host "Registry backup: $backupFile" -ForegroundColor Green
# Record original value
$properties = Get-ItemProperty -Path $regPath
$originalValue = $properties.SystemComponent
if ($null -eq $originalValue) {
throw 'SystemComponent value not found. No changes made.'
}
try {
# Make WebView2 visible in Installed Apps
Set-ItemProperty -Path $regPath `
-Name SystemComponent `
-Value 0 `
-Type DWord
Write-Host 'WebView2 is now visible in Installed Apps.' -ForegroundColor Green
# Open Windows Installed Apps
Start-Process 'ms-settings:appsfeatures'
Write-Host ''
Write-Host 'Complete the following steps:' -ForegroundColor Cyan
Write-Host '1. Find Microsoft Edge WebView2 Runtime.'
Write-Host '2. Select the three-dot menu (...).'
Write-Host '3. Select Modify.'
Write-Host '4. Select Repair and wait for completion.'
Write-Host ''
Read-Host 'Press Enter after the repair finishes'
}
finally {
# Restore original registry value
if (Test-Path $regPath) {
Set-ItemProperty -Path $regPath `
-Name SystemComponent `
-Value $originalValue `
-Type DWord
Write-Host "SystemComponent restored to $originalValue" -ForegroundColor Green
}
}
# Verify runtime
$guid = '{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}'
$clientPath = "HKLM:\SOFTWARE\Microsoft\EdgeUpdate\Clients\$guid"
$version = (Get-ItemProperty $clientPath -ErrorAction SilentlyContinue).pv
$exe = if ($version) {
Join-Path "${env:ProgramFiles(x86)}\Microsoft\EdgeWebView\Application" "$version\msedgewebview2.exe"
}
Write-Host ''
Write-Host 'WebView2 verification:' -ForegroundColor Cyan
[PSCustomObject]@{
RegisteredVersion = $version
ExecutablePresent = [bool]($exe -and (Test-Path $exe))
RegistryBackup = $backupFile
} | Format-List
Write-Host 'Launch Teams to verify the repair.' -ForegroundColor Yellow
Launch Teams to verify the installation