The PSADT Templates tab (Settings → PSADT Templates) lets you build and manage reusable
PowerShell customization sets that layer onto the active PSADT toolkit. Each template persists
outside the toolkit folder, so they survive toolkit downloads and updates.
What is a template? In XOAP Package Wizard, every package is built from a stock PSADT
toolkit (the bundled v4 template or a GitHub-downloaded release). A PSADT Template is a
named set of your own PowerShell code, helper files, and assets that gets injected into
generated scripts at build time. It’s different from the bundled "template" you may see
mentioned elsewhere — that term refers to the stock toolkit itself.
Template Contents #
Each template can carry:
- Support Files — Helper scripts, tools, or data files copied to
SupportFiles/in exports - Files — Additional installer files or configuration copied to
Files/(workspace-uploaded files take precedence) - Assets — Images, icons, or other assets copied to
Assets/(useful for custom AppIcon.png) - Extensions Code — PowerShell code appended to
PSAppDeployToolkit.Extensions.psm1(e.g. custom functions for your organization’s patterns) - Script Functions — PowerShell functions injected into
Invoke-AppDeployToolkit.ps1before the Initialization block (e.g. helper functions called from phase code)
Managing Templates #
The PSADT Templates tab shows a table with these columns:
| Column | Description |
|---|---|
| Name | Template name; shows a ⭐ badge if this is the default template |
| Description | Your summary of what this template contains |
| Contents | Count summary, e.g. "3 support files · 1 asset · extensions code" |
| Modified | Date the template was last saved |
Creating a Template #
Click the New Template button to open the template editor drawer:
- Name (required) — A short identifier for this template (e.g.
"Contoso Enterprise") - Description — Optional notes about what it contains
- Files tab — Upload files to Support Files, Files, and Assets areas (after saving once; new unsaved templates show a hint)
- Extensions Code tab — Write PowerShell that will be appended to the toolkit’s
PSAppDeployToolkit.Extensions.psm1 - Script Functions tab — Write PowerShell functions that will be injected into the generated script (useful for custom helpers)
Click Save to persist the template.
Editing a Template #
Click the edit (pencil) icon on any template row to open the drawer and modify its name,
description, code, or files. Changes are persisted when you click Save.
Duplicating a Template #
Click the duplicate (copy) icon to create a clone of the template with " (copy)" appended to
the name. The new template starts with the same files and code but is not the default.
Exporting a Template #
Click the export (download) icon to download the template as a portable .zip file. The zip
contains:
PsadtTemplate-{name}.zip
├── template.json (manifest with name, description, code)
├── SupportFiles/ (optional) (files from the Support Files area)
├── Files/ (optional) (files from the Files area)
└── Assets/ (optional) (files from the Assets area)
You can share this zip with colleagues, version-control it, or archive it.
Importing a Template #
Click the Import button to open a file picker. Select a template .zip (exported from
another instance, or a custom zip you’ve built):
- With manifest — The zip contains
template.json; the template’s name and description are
imported from it. If a template with the same name already exists, " (imported)" is appended
to the name to avoid a collision. - Without manifest — The zip contains only folder structure (
SupportFiles/,Files/,
Assets/); the template is named after the zip filename (without.zip), and only those
three areas are imported. Code fields stay empty.
Imports are zip-slip protected and support single-root unwrap (if the zip’s only top-level entry
is a folder).
⚠️ Review imported code. A template’s extensions code and script functions are PowerShell
that runs with your privileges in every package that uses the template. An imported template
is therefore never made the default automatically — open it, review its code, and set it as
default yourself once you trust it. The app shows a warning after importing a template that
contains code.
Setting a Default Template #
Click the star icon on a template row to mark it as the default. New PSADT packages
automatically use the default template on the Session Config step. You can clear the default by
clicking the star icon again (or by deleting the default template — the default is then cleared).
Using Templates in Packages #
When you create a new PSADT package, the Session Config step shows a PSADT Template dropdown
near the top of the session card. Choose from:
- None (stock toolkit) — Use the unmodified toolkit (the default if no template is set as default)
- (default) — Pre-selected; your default template
- — Other available templates
Changing the dropdown immediately updates the package’s template selection. The template is
applied whenever you:
- Generate the script — Preview step renders the script with template extensions and functions injected
- Export the package — All formats (ZIP, intunewin, MSIX, App Attach, cloud uploads) include template files and code
- Run a test — Test Run stages template files and uses the extended script
How Templates Work #
Layering and precedence:
- SupportFiles and Assets: Template files win over toolkit files (same relative path). Workspace-uploaded files do not go into these directories.
- Files: Workspace-uploaded package files win over template files (same relative path). If workspace has no Files but the template does, the "Add Setup Files Here.txt" placeholder is omitted.
- Extensions Code: Appended to the toolkit’s
PSAppDeployToolkit.Extensions.psm1(in a#region XOAP PSADT templateblock, before the banner that precedes## MARK: SCRIPT BODY) - Script Functions: Injected into
Invoke-AppDeployToolkit.ps1before the Initialization block (in a plaintext banner without## MARK:prefix, so parsing does not get confused)
Persistence across toolkit updates:
Templates are stored at %AppData%\XOAP\PackageWizard\psadt-templates.json (manifest and metadata) and
%AppData%\XOAP\PackageWizard\psadt-templates/{id}/ (payload folders). Because nothing is written
into the toolkit folder (%AppData%\XOAP\PackageWizard\Toolkit/), templates are untouched when you
download a new PSADT release. The Extensions code always uses the active toolkit’s module version,
so version pins in the module’s .psd1 stay in sync with your chosen toolkit.
Edition Availability #
PSADT Templates are available in both Free and Pro editions. There is no lock badge or Pro gate on the PSADT Templates page.