Add AppxProvisionedPackage - PowerShell


Overview

Add-AppxProvisionedPackage allows the installation and provisioning of an AppX Windows app package (.appx or .msix) on a specified device. It’s useful for deploying and managing apps in enterprise environments, app development, and testing scenarios.

Syntax

Add-AppxProvisionedPackage -Path <FilePath> [[-LicenseFilePath] <FilePath>] [[-TargetDevice] <DeviceID>] [[-Force]|[-AllowAllTrusted]] [[-InstallScope] <String>]

Options/Flags

  • -Path: Path to the AppX Windows app package (.appx or .msix).
  • -LicenseFilePath: Path to a license file for the app (optional).
  • -TargetDevice: Device ID for the target device. Defaults to the current device if not specified (optional).
  • -Force: Forces the installation even if there are conflicts or if the app is already installed.
  • -AllowAllTrusted: Allows the installation of apps from any trusted publisher, regardless of their publisher identity (optional).
  • -InstallScope: Scope of the installation (optional):
    • User: Installs the app for the current user only.
    • Device: Installs the app for all users on the device.

Examples

Simple Installation

Add-AppxProvisionedPackage -Path "C:\path\to\app.appx"

Installation with License File

Add-AppxProvisionedPackage -Path "C:\path\to\app.appx" -LicenseFilePath "C:\path\to\license.xml"

Installation on a Specific Device

Add-AppxProvisionedPackage -Path "C:\path\to\app.appx" -TargetDevice "1234567890ABCDEF"

Forcing Installation

Add-AppxProvisionedPackage -Path "C:\path\to\app.appx" -Force

Common Issues

  • Installation fails with error 0x80073cf9: Ensure the app package is compatible with the target device and OS version.
  • Provisioning fails: Verify that the device is properly registered and the user has appropriate permissions.
  • Appx not found: Check the provided path and ensure the appx file exists.

Integration

Add-AppxProvisionedPackage can be combined with other cmdlets for advanced app management tasks.

  • Get-AppxProvisionedPackage: Retrieve information about installed provisioned packages.
  • Remove-AppxProvisionedPackage: Uninstall a provisioned package.
  • Export-AppxProvisionedPackage: Export a provisioned package for deployment on other devices.
  • Install-AppxPackage: Installs an AppX package on the current device.
  • Get-AppxPackage: Retrieves information about installed AppX packages.
  • Update-AppxPackage: Updates an existing AppX package.