A simple PowerShell-based tool with optional GUI to build Microsoft 365 deployment packages.
- PowerShell 7 or later
To use the optional GUI:
- Node.js from https://nodejs.org
- Open a PowerShell window.
- Navigate to the folder.
- Run:
.\Invoke-M365AppsHelper.ps1 -ConfigXML .\samples\sample.xml -OnlineModeThis will create a lightweight Microsoft 365 Apps deployment package.
-OnlineModecreates a lightweight stub package (justsetup.exeand metadata). The Office binaries are downloaded during install.- If
-OnlineModeis not passed, the script downloads all Office data files into the package. This can be preferred for fully offline installs, but results in very large downloads (multi-GB). - Zip compression is only performed when using
-PMPCCustomApp. In this case, Office data files will be compressed by default and a PreScript will be generated to extract them during install. Use the-NoZipparameter with-PMPCCustomAppif you do not want to compress the Office data files. - For all other scenarios, zip compression is never performed and the Office files are included as a folder.
⚠️ Note: The sample XML's are for example purposes only.
You should generate your own configuration at https://config.office.com and export the XML.
- Install Node.js LTS
- Download the latest release zip and unpack to a folder.
- Open PowerShell, change directory to the same folder.
- Run:
npm install
npm startThe GUI will launch. This may take a minute the first time as node modules are downloaded.
This tool is ideal for:
You can use your exported XML file from config.office.com and:
- Automatically generate a ready-to-upload
.intunewinpackage - Includes:
setup.exe- install.xml and uninstall.xml generated from your provided xml
- Optional full Office content (if not using
-OnlineMode)
- Detection Script (Leveraging DisplayName and DisplayVersion)
- Microsoft Logo
- Win32 app details.txt file that tells you exactly what to fill in during Intune app creation (install/uninstall commands, detection, and metadata)
If you're a Patch My PC customer, add the -PMPCCustomApp parameter:
.\Invoke-M365AppsHelper.ps1 -ConfigXML .\your.xml -PMPCCustomAppThis will generate all files and metadata required to create a Custom App in the Patch My PC Cloud portal, including:
- Includes:
setup.exe- install.xml and uninstall.xml generated from your provided xml
- Optional full Office content (if not using
-OnlineMode) - Compressed Office content and PreScript (if not using
-OnlineMode). Use the-NoZipparameter if you do not want to compress the office data files.
ConfigXML Path to the Office configuration XML. If omitted, the script auto-detects a single XML in the script folder.
Type: String
Required: False
Default: Auto-detect single XML
Incompatible with: None
BasePath
Root path for output folders (Packages, Downloads, Logs).
Type: String
Required: False
Default: $env:APPDATA\M365AppsHelper
Incompatible with: None
SetupUrl Office setup executable download URL.
Type: String
Required: False
Default: https://officecdn.microsoft.com/pr/wsus/setup.exe
Incompatible with: None
OfficeVersionUrl Office version API endpoint used for validation.
Type: String
Required: False
Default: https://clients.config.office.net/releases/v1.0/OfficeReleases
Incompatible with: None
OfficeIconUrl
Icon download URL (saved as Microsoft.png).
Type: String
Required: False
Default: https://www.svgrepo.com/show/452062/microsoft.svg
Incompatible with: None
LogName Log file name or full path.
Type: String
Required: False
Default: Invoke-M365AppsHelper.log
Incompatible with: None
Win32ContentPrepToolUrl
Win32 Content Prep Tool URL (IntuneWinAppUtil.exe).
Type: String
Required: False
Default: https://raw.githubusercontent.com/microsoft/Microsoft-Win32-Content-Prep-Tool/master/IntuneWinAppUtil.exe
Incompatible with: None
CreateIntuneWin
Generate a .intunewin package (non-PMPC custom app).
Type: Switch
Required: False
Default: False
Incompatible with: PMPCCustomApp
NoZip
Skip creating Office.zip when Office content is downloaded. Only relevant when using -PMPCCustomApp. For all other scenarios, zip compression is never performed and this parameter is always true.
Type: Switch
Required: False
Default: True (unless using PMPCCustomApp, where it defaults to False)
Incompatible with: None
OnlineMode Build a stub package only (no Office binaries). Without this switch, full Office data files are downloaded (large).
Type: Switch
Required: False
Default: False
Incompatible with: None
SkipAPICheck Skip Office API validation (only works if a version is set in the XML).
Type: Switch
Required: False
Default: False
Incompatible with: None
PMPCCustomApp
Generate PMPC custom app output instead of standard Win32 output. Enables zip compression by default unless -NoZip is specified.
Type: Switch
Required: False
Default: False
Incompatible with: CreateIntuneWin
ApiRetryDelaySeconds Delay in seconds between API retries.
Type: Integer
Required: False
Default: 3
Range: 1-30
Incompatible with: None
ApiMaxExtendedAttempts Maximum API retry attempts.
Type: Integer
Required: False
Default: 10
Range: 1-20
Incompatible with: None
- Created by: Ben Whitmore @ Patch My PC
- Filename:
Invoke-M365AppsHelper.ps1 - Created on: 07/09/2025
- Updated on: 22/02/2025
This script automates the process of creating Microsoft 365 Office deployment packages by:
- Parsing Office configuration XML files (no hardcoded values)
- Downloading the required setup files
- Creating organized deployment packages
- Supporting zip packaging with optional PreScript
- Validating Office versions using Microsoft’s public Office REST API
If your XML defines a version, the script will:
- Query Microsoft’s API to confirm the version is valid for the specified channel
- Prevent deployment failures from invalid/nonexistent Office builds
If no version is specified, the latest version for the channel will be used automatically.
The script also:
- Retries API queries when needed (e.g., rate limiting, incomplete responses)
- Helps ensure builds are accurate and up-to-date
- No admin rights needed
- All processing is local
- No data is sent externally
GPL-3.0 — see LICENSE