MSiX and Integrated PowerShell Scripts

MissouriSpartan 1 Reputation point
2021-02-01T20:19:50.063+00:00

I have been learning how to use the MSiX Package Creation tool Microsoft provides, to package apps into Intune for my company.

However, a part I am having trouble at is:

How does one get a PowerShell script to run automatically as part of the package? Several of our applications require license files or configuration files to auto-copy to a specific location on the system (or in the user appdata directory). Is there any efficient way to automate this as part of the package or to allow a PowerShell script to run silently after the MSI has run? I'm still new to this, so my apologies if I sound naive. Are there any MSiX experts out there who can assist me with this?

Let's say in this case I:

  1. Run the MSI installer (main part of the MSiX package) to install the application the way I need it to be. then,
  2. run a PowerShell script silently and automatically right after the installation has finished, to copy down certain items (like license or configuration files) into certain directories.

Is the above scenario possible with MSiX and using the Microsoft MSiX Package Creation Tool?

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,462 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
4,743 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Lu Dai-MSFT 28,371 Reputation points
    2021-02-02T06:40:48.497+00:00

    @MissouriSpartan Thanks for posting in our Q&A.

    For this issue, I have an idea for reference. We can write PowerShell Scripts that contain installing the application and copying certain items into certain directories. Then we can package the PowerShell Script and the MSiX package as (.intunewin) file format and deploy it to the device via Win23 app.

    For deploy win32 app, we can read the following articles as a reference.
    https://learn.microsoft.com/en-us/mem/intune/apps/apps-win32-prepare
    https://learn.microsoft.com/en-us/mem/intune/apps/apps-win32-add

    Thanks for understanding.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.