Workaround for Microsoft Edge crashing for users with roaming profiles

There is a bug in Microsoft Edge with Windows 10 1511 if you’re logged in with an account that uses roaming profiles. At least it’s a bug for me at work, and others from what I see online. After you restart or logoff and logon, when you start Edge the window opens and then immediately closes.  There is an open feedback item on Microsoft Connect from November 18 that describes this issue. It’s pretty annoying, but it isn’t the first oddness I’ve experienced with Edge and roaming profiles. (We’re working to move away from them and use UE-V, but we’re not quite there yet.)

The workaround in the bug report posted by Michael Mairegger indicated that re-registering Edge via PowerShell fixed the problem. In his solution he deletes the entire Edge package folder before re-registering. I wasn’t sure if there was anything in the other folders that I wanted/needed to keep, and I figured out that all that was needed was to delete something from the package files before re-registering. I wound up deleting the folder %LocalAppData%\Packages\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\AC\Temp before re-registering the package because it’s a temp folder and normally empty when Edge isn’t running. I figured that was a safe choice.

So what I use is the following script. It runs at logon as a scheduled task.

# Get LOCALAPPDATA folder and remove a temp folder from the Edge package location
$LocalAppData = Get-Content env:LOCALAPPDATA
Remove-Item "$LocalAppData\Packages\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\AC\Temp"

# Re-register Edge
Get-AppXPackage Microsoft.MicrosoftEdge | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}

It’s quick and dirty, but it works until Microsoft gets around to fixing this issue.