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:

  1. Add the below command and save it as .ps1 file. This Powershell script will install the MSIX file.
  2. Add-AppxPackage -Path <MSIX_file_name_with_extension>

    Example: Add-AppxPackage -Path MSTeams-x86.msix

  3. Navigate to Software Deployment → Packages → Add package → Windows
  4. Enter the package name and choose the package type as EXE/APPX/MSIEXEC/MSU
  5. Select the license type as Non-Commercial from the drop down menu
  6. Locate the installableFrom local computer
  7. Upload the PowerShell script file and MSIX file in the package.
  8. Provide the below installation command. This command will trigger the PowerShell script.
  9. powershell.exe -ExecutionPolicy RemoteSigned -File <powershell_script_name_with_extension>

    Example: powershell.exe -ExecutionPolicy RemoteSigned -File testFile.ps1

  10. If necessary, configure predeployment and postdeployment activities
  11. 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.