Skip to content

Instantly share code, notes, and snippets.

$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle -OutFile DesktopAppInstaller.msixbundle
Invoke-WebRequest -Uri https://github.com/microsoft/winget-cli/releases/latest/download/DesktopAppInstaller_Dependencies.zip -OutFile DesktopAppInstaller.zip
Expand-Archive DesktopAppInstaller.zip
Add-AppxPackage -Path DesktopAppInstaller.msixbundle -DependencyPath .\DesktopAppInstaller\x64\*
Remove-Item DesktopAppInstaller* -Recurse
$Path = Get-ChildItem -Path "$Env:ProgramFiles (x86)\Microsoft\Edge\Application\*\Installer\setup.exe" | Select-Object -First 1
$Directory = "$Env:SystemRoot\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe"
New-Item -Path $Directory -ItemType Directory
New-Item -Path $Directory\MicrosoftEdge.exe -ItemType File
Start-Process -FilePath $Path -ArgumentList '--uninstall --system-level --force-uninstall --delete-profile' -Wait