PowerShell – Install AppX via Command Line

email me

Command

powershell.exe -noprofile -command “Add-AppxPackage -Path .\setup.appx”

 

Output

 


Notes

Example 1: Add an app package

PS C:\> Add-AppxPackage -Path “C:\Users\GeorgeStark\Desktop\MyApp.appx” -DependencyPath “C:\Users\GeorgeStark\Desktop\winjs.appx”


Example 2: Add a disabled app package in development mode

PS C:\> $ManifestPath = (Get-AppxPackage -Name “*WindowsCalculator*”).InstallLocation + “\Appxmanifest.xml”

PS C:\> Add-AppxPackage -Path $ManifestPath -Register -DisableDevelopmentMode


Example 3: Add an app along with its optional packages

PS C:\> Add-AppxPackage -Path “C:\Users\GeorgeStark\Desktop\MyApp.appxbundle” -ExternalPackages

“C:\Users\user1\Desktop\optionalpackage1.appx”,”C:\Users\GeorgeStark\Desktop\optionalpackage2.appxbundle”

PS C:\> Add-AppxPackage -Path “C:\Users\GeorgeStark\Desktop\MyApp.appxbundle” -OptionalPackages “29270sandstorm.OptionalPackage1_gah1vdar1nn7a”


Example 4: Install only the required section of a streaming app

PS C:\> Add-AppxPackage -Path “C:\Users\GeorgeStark\Desktop\MyApp.appxbundle” -RequiredContentGroupOnly

* hopefully you get my humor with George Stark.

 

tags: MrNetTek