The Add-AppXPackage Cmdlet

The Add-AppXPackage cmdlet has several use cases.


Installing a simple package

The most common use case of Add-AppPackage is to install a simple package. As a general best practice, file paths should be enclosed in double quotes to account for spaces in the path and allow for the use of variables in the file path (if needed).


Add-AppXPackage -Path “C:\Packages\MyPackage\MyPackage.msix”

Handling package dependency packages

Packages may include a listing of dependency packages in their manifests. These dependencies, which are generally packages with commonly used components like runtimes and frameworks, must be available for the package to be installed. Dependencies of a package may be installed first, prior to this package, or may be installed at the same time using the DependencyPath parameter.


Add-AppXPackage 
    -Path 
    “C:\Packages\MyPackage\MyPackage.msix” 
    -DependencyPath   
    “C:\Packages\MyPackage\MyPackageDependency.msix”

Handling External (Modification or Optional) packages

Modification Packages are examples of how the ExternalPackage option may be used. While the modification package may be installed using the first Add-AppXpackage after the primary package is installed, it may also be installed with the primary package this way. It is important to note that ExternalPackages is an atomic operation which means that if the additional packages fail to install, the whole installation operation is aborted.


The ExternalPackages parameter specifies an array of one or more strings that contain file paths.

Add-AppXPackage 
    -Path 
    "C:\Packages\MyPackage\MyPackage.msixbundle" 
    -ExternalPackages 
    "C:\Packages\MyPackage\OptionalPackage.msix",
    "C:\Packages\MyPackage\OptionalPackageBundle.msixbundle"

Handing RequiredContentGroups


One feature that a software developer can use to improve installation performance of a large package is to install only the required components and trigger the rest of the components to install later. Microsoft refers to this as application streaming, although it is unrelated to the App-V style of streaming that MSIX does not implement. An example of this may be a game where additional levels are not needed until the user finishes early levels, but optional features that can be triggered by a user-interface component could also be implemented by the developer this way. When such a package is built, the installation can use the RequiredContentGroupOnly parameter, which installs only the required components of the application, leaving the optional components registered in a way that the application can later trigger the download of optional content.


Add-AppXPackage -Path "C:\Packages\MyPackage\MyPackage.msixbundle" -RequiredContentGroupOnly