Skip to content

Instantly share code, notes, and snippets.

@chsbuffer
Created October 21, 2022 04:08
Show Gist options
  • Save chsbuffer/b332b2a06190bc904129df04c22b3246 to your computer and use it in GitHub Desktop.
Save chsbuffer/b332b2a06190bc904129df04c22b3246 to your computer and use it in GitHub Desktop.
Fix uwp apps alias won't start from Run or File Explorer
# https://github.com/microsoft/terminal/issues/7081#issuecomment-1065833836
$WinAppsPaths = @("C:\Program Files\WindowsApps")
$UserAppsPaths = @("$env:LOCALAPPDATA\Microsoft\WindowsApps")
$UserProfile = @("$env:USERPROFILE")
Get-ChildItem "HKCU:\Software\Microsoft\Windows\CurrentVersion\App Paths" | ForEach-Object {
$v = $_.GetValue('')
if (${v}?.StartsWith($WinAppsPaths)) {
$_ | Set-ItemProperty -Name "(default)" -Value "$UserAppsPaths\$($_.PSChildName)"
$_ | Set-ItemProperty -Name "Path" -Value $UserProfile
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment