How to uninstall an UWP app programmatically How to uninstall an UWP app programmatically powershell powershell

How to uninstall an UWP app programmatically


Try something like this:

$AppList = "AppleInc.iTunes"ForEach ($App in $AppList) {    $PackageFullName = (Get-AppxPackage $App).PackageFullName    $ProPackageFullName = (Get-AppxProvisionedPackage -online | where {$_.Displayname -eq $App}).PackageName    write-host $PackageFullName    Write-Host $ProPackageFullName    if ($PackageFullName) {        Write-Host "Removing Package: $App"        remove-AppxPackage -package $PackageFullName    }    else{        Write-Host "Unable to find package: $App"    }    if ($ProPackageFullName) {        Write-Host "Removing Provisioned Package: $ProPackageFullName"        Remove-AppxProvisionedPackage -online -packagename $ProPackageFullName    }    else {        Write-Host "Unable to find provisioned package: $App"    }}