How to deploy MSIX Files via Powershell script?
Description
If the user wants to deploy MSIX files, then it can be achieved with the help of the following steps.
Steps:
- Add the below command and save it as .ps1 file. This Powershell script will install the MSIX file.
Add-AppxPackage -Path <MSIX_file_name_with_extension>
Example: Add-AppxPackage -Path MSTeams-x86.msix
- Navigate to Software Deployment → Packages → Add package → Windows
- Enter the package name and choose the package type as EXE/APPX/MSIEXEC/MSU
- Select the license type as Non-Commercial from the drop down menu
- Locate the installableFrom local computer
- Upload the PowerShell script file and MSIX file in the package.
- Provide the below installation command. This command will trigger the PowerShell script.
powershell.exe -ExecutionPolicy RemoteSigned -File <powershell_script_name_with_extension>
Example: powershell.exe -ExecutionPolicy RemoteSigned -File testFile.ps1
- If necessary, configure predeployment and postdeployment activities
- Click the Add Package button.
Note: The MSIX package is a user-based package so when deploying via configuration, navigate to Configurations tab, choose Configurations → Windows → Custom Scripts. When publishing to Self Service Portal, publish to the user group.