Add-AppxProvisionedPackage -Online -PackagePath "C:\MyApp.msix" -SkipLicense Add-AppxProvisionedPackage is more for OS image customization (Windows PE, unattend.xml). For everyday deployment, Add-AppxPackage -Scope Machine is preferred. Method 3: MSIX Module’s Install-MsixPackage (Simplest) Once you install the MSIX module, life becomes easier:
<# .SYNOPSIS Installs an MSIX package for all users on the local machine silently. .PARAMETER MsixPath Full path to the .msix or .msixbundle file #> param( [Parameter(Mandatory=$true)] [ValidateScript(Test-Path $_ -PathType Leaf)] [string]$MsixPath ) $currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) if (-not $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) Write-Host "ERROR: This script must be run as Administrator." -ForegroundColor Red exit 1001 Enable sideloading if not already $regPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" Set-ItemProperty -Path $regPath -Name "AllowAllTrustedApps" -Value 1 -Type DWord -Force install msix powershell all users
However, one question plagues IT administrators and system integrators more than any other: Add-AppxProvisionedPackage -Online -PackagePath "C:\MyApp
<# .FILE: Deploy-MsixAllUsers.ps1 .DESCRIPTION: Installs MSIX package for all users with dependency and cert management #> param( [string]$MsixUrl = "https://internal.cdn/MyApp.msix", [string]$CertificateUrl = "https://internal.cdn/MyApp.cer", [string[]]$DependencyUrls = @() ) param( [string]$MsixUrl = "https://internal.cdn/MyApp.msix"
Add-AppxPackage -Path "\\server\share\MyApp.msix" -Scope Machine -ErrorAction Stop
# Install certificate to Trusted Root store (machine-wide) Import-Certificate -FilePath ".\yourApp.cer" -CertStoreLocation "Cert:\LocalMachine\Root" If you skip this, you’ll get the dreaded: Deployment failed because the package's certificate is not trusted on the system. Method 1: Using Add-AppxPackage (Native, but Tricky) The Add-AppxPackage cmdlet has a -Scope parameter.