Managing modern apps | Managing Appx Packages
Location
Modern apps are located at the following:
%WINDIR%\SystemApps
(For system apps; ie Edge, Cortana, etc)
%PROGRAMFILES%\WindowsApps
(For personal apps; ie Pictures, Videos, Calculator, etc)
The Way Appx Packages Works
Modern Apps are "provisioned" on the system. This means they are available to every account on the system to be installed. When this happens, the appx is now on a "manifest-list" or provisioned-list. When a new account signs in for the first time, all the provisioned-appx packages are installed for that account.
Modern Apps are then installed per account.
Get Modern Apps
Here is how to get a list of all provisioned packages on a system:
get-appxprovisionedPackage -online |select Packagename
Here is how to get a list of all Modern Apps installed for all accounts on the system:
Get-AppxPackage -allusers |select PackageFullName
Or for a specific account:
Get-AppxPackage -user "domain\FooAccount"
Removing Modern Apps
Here is how to remove a single Modern App:
Remove-AppXProvisionedPackage -Online -PackageName <PackageName>
Since AppX packages use random names, it is probably easier to:
Get-AppxPackage |where {$_packagefullname -like "*zune*"} |remove-appxpackage
Here is how to remove all Modern Apps:
Get-AppXProvisionedPackage -Online | Remove-AppxProvisionedPackage -Online
If you want to remove all but keep a certain set of Modern Apps, following will work but the Appx packages will come back during OS verion upgrade (ie v2004 to v2009).
##Remove All Packages
$appname = @(
"*BingWeather*"
"*ZuneMusic*"
"*ZuneVideo*"
"*King*"
)
ForEach($app in $appname){
Get-AppxPackage -AllUsers -Name $app | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue
}
Removing Modern Apps from the Manifest List / Provisioned List
But how to remove appx packages from the provisioned-list. Here's how:
##Remove Provisioned Packages
$appname = @(
"*BingWeather*"
"*ZuneMusic*"
"*ZuneVideo*" "*king*"
)
ForEach($app in $appname){
Get-AppxProvisionedPackage -Online | where {$_.PackageName -like $app} | Remove-AppxProvisionedPackage -AllUsers -Online -ErrorAction SilentlyContinue }
Adding Modern Apps
Adding Modern Apps can be challenging because of the random characters in the PakcageName.
There are 4 steps:
1-find the URL of the app
To do this, simply go to https://www.microsoft.com and find the URL of the app. For SpeedTest, that is:
https://www.microsoft.com/en-us/p/speedtest-by-ookla/9nblggh4z1jc
2-Generate the Microsoft Store link
To do this, go to https://store.rg-adguard.net
Be sure to change the option to RETAIL
3-Download the appxBundle
4-Install the appxBundle:
add-appxpackage -path "c:\path\to\file\Ookla.SpeedtestbyOokla_1.13.154.0_neutral_~_43tc6nmvykmb6.appxbundle"
add-appxprovisionedpakage -online skiplicense -packagepath "c:\path\to\file\Ookla.SpeedtestbyOokla_1.13.154.0_neutral_~_43tc6nmvykmb6.appxbundle"
Reference the PDQ article below, they are the experts.
Basically, the following will install an appx package to an account:
#########################################################
##THIS WILL INSTALL ALL CANDY CRUSH GAMES! DO NOT RUN! ##
#########################################################
$path = Get-ChildItem -Path "C:\Program Files\WindowsApps" | Where-Object {$_.BaseName -like "*Candy*"} | select fullname $registerpath = $path.FullName + "\appxmanifest.xml"
Add-AppxPackage -DisableDevelopmentMode -Register $registerpath
Adding Modern Apps to the Manifest
Basically, the following will provision an Appx package:
$ManifestPath = (Get-AppxPackage -Name "*WindowsCalculator*").InstallLocation + "\Appxmanifest.xml"
Add-AppxPackage -Path $ManifestPath -Register -DisableDevelopmentMode
Winget
winget can do the same.
winget
If you need to set settings:
winget settings
If you want to see the source list:
winget source list
You will see the msstore in the list.
If you want to reset the sources/repos:
winget source reset
Now search the repo:
winget search |findstr msstore |more
winget search white |findstr msstore
winget search 9MSPC6MP8FM4
winget search Whiteboard
Now simply install from the rep:
winget install "Dell Command | Update"
echo y |winget install "Microsoft Whiteboard"
Notes
This article says it better than I can:
https://www.pdq.com/blog/removing-windows-10-apps-and-advertising/
https://www.pdq.com/powershell/add-appxpackage/