Remove-AppxPackage -Package "MyAppPublisher.MyApp_1.2.3.0_x64__8wekyb3d8bbwe" For all users:
if ($ForAllUsers) $params.Add("Register", $true)
Get-AppxPackage -AllUsers -Name "*MyApp*" | Remove-AppxPackage -AllUsers <# .SYNOPSIS Installs an MSIX bundle silently with validation. .DESCRIPTION Checks admin rights, OS compatibility, architecture, and dependencies before installing. #> param( [Parameter(Mandatory)] [ValidateScript(Test-Path $_ -PathType Leaf)] [string]$BundlePath,
| Cmdlet | Purpose | |--------|---------| | Add-AppxPackage | Install an MSIX/Appx package or bundle | | Get-AppxPackage | List installed packages | | Remove-AppxPackage | Uninstall a package | | Add-AppxVolume | Manage installation on external drives | Install an MSIX bundle for the current user :
[switch]$ForAllUsers ) if ($ForAllUsers -and (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))) throw "Administrator rights required for -ForAllUsers" Install $params = @ Path = $BundlePath ForceApplicationShutdown = $true ErrorAction = "Stop"
catch Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red exit 1
try Write-Host "Installing $BundlePath ..." -ForegroundColor Cyan Add-AppxPackage @params Write-Host "Installation succeeded." -ForegroundColor Green