- Obtain PSADT 4.1.8 from the PowerShell Gallery or from a GitHub release
- Create a new package with New-ADTTemplate and name the purpose of each folder
- Find the Pre, main and Post sections for Install, Uninstall and Repair in the wrapper script
- Fill in the $adtSession metadata and predict the resulting log file name
- Choose between the Auto, Interactive, NonInteractive and Silent deploy modes
Lesson 1 ended with a raw silent installation. This lesson builds the container around it: a PSADT package. It covers where PSADT comes from, what every folder in a package is for, how the wrapper script is laid out, and how the toolkit decides whether to show dialogs. The exercise runs a first package that installs nothing but writes a complete log.
Getting PSADT 4.1
The download page of the official documentation names two sources: the PowerShell Gallery and the GitHub releases. Version 4.1.8 was released on 2026-01-14 and is the latest stable release on 2026-11-29.
Before the first module command. On Windows clients, the default execution policy is Restricted, which also blocks module files (.psm1) (about_Execution_Policies). Install-Module and New-ADTTemplate then fail with "running scripts is disabled on this system". This command allows scripts in the current console only:
# Allow scripts and modules in this console session only
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -ForceA policy set by Group Policy (MachinePolicy or UserPolicy in Get-ExecutionPolicy -List) cannot be overridden this way.
PowerShell Gallery. The module is installed once on the packaging machine:
# Install PSADT 4.1.8 for the current user
Install-Module -Name PSAppDeployToolkit -RequiredVersion 4.1.8 -Scope CurrentUser
# Confirm the installed version
Get-Module -Name PSAppDeployToolkit -ListAvailable | Select-Object -Property Name, VersionWithout -RequiredVersion, Install-Module installs the latest stable version, which will be 4.2 once it is released; the course therefore pins 4.1.8. Windows PowerShell 5.1 ships with PowerShellGet 1.0.0.1. According to Microsoft's PowerShellGet instructions, the Gallery requires TLS 1.2. If Install-Module cannot reach the Gallery, run [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 first. Microsoft no longer supports PowerShellGet 1.x and recommends updating it. On a machine that has never used the Gallery, PowerShellGet 1.0.0.1 asks two questions. The first offers to install the NuGet provider (default Y). The second reports an Untrusted repository and asks to confirm installing from PSGallery; its default is N, so pressing Enter cancels the installation. Answer Y to both.
GitHub releases. The 4.1.8 release of the PSAppDeployToolkit/PSAppDeployToolkit repository has three assets plus the source code:
| Asset | Content |
|---|---|
PSAppDeployToolkit_ | The module only. The download page calls it the minimum download. |
PSAppDeployToolkit_ | A ready v4 package skeleton |
PSAppDeployToolkit_ | A skeleton for v3 compatibility mode, for existing 3.x scripts |
This route suits packaging machines without Gallery access. A ZIP downloaded with a browser carries the "downloaded from the internet" mark, which extraction can pass on to the files; under RemoteSigned, PowerShell does not run such unsigned scripts until they are unblocked:
# Remove the internet zone mark from all extracted template files
Get-ChildItem -Path 'C:\Lab\Packages\HelloPSADT' -Recurse -File | Unblock-File/docs/ paths. The 4.1 reference used in this course lives under /docs/4.1.x/. Version 4.2.0 is a release candidate on 2026-11-29; its changes are summarised in PSADT 4.2 RC2 for ConfigMgr and Intune Packagers.
Creating a package
With the module installed, New-ADTTemplate creates a new package folder:
# Create a new v4 package folder named HelloPSADT under C:\Lab\Packages
New-ADTTemplate -Destination 'C:\Lab\Packages' -Name 'HelloPSADT'| Parameter | Default | Meaning |
|---|---|---|
-Destination | Current location | Folder in which the package folder is created |
-Name | PSAppDeployToolkit_ | Name of the new package folder |
-Version | 4 | 4 for the v4 template, 3 for v3 compatibility mode |
-Show | Off | Opens the new folder in File Explorer |
-Force | Off | Replaces an existing, non-empty folder |
-PassThru | Off | Returns the new folder as an object |
No parameter is mandatory. According to the 4.1.8 source, the function creates Files\ and SupportFiles\ with one placeholder text file each, copies the v4 front end (launcher, wrapper script, PSAppDeployToolkit.Extensions\) and the default Assets\, Config\ and Strings\ folders, and places a complete copy of the module in PSAppDeployToolkit\. It marks the module copy read-only, points the Import-Module line of the wrapper at that copy, and replaces the placeholder script date 2000-12-31 with the current date.
-Force does not merge. If the target folder exists and is not empty, the function stops with an error; with -Force, it deletes the existing folder and everything in it before creating the template.
The package is self-contained: it carries its own copy of the module and does not need PSADT installed on the target device.
The package folder
The 4.1 documentation describes the deployment structure. A package created by New-ADTTemplate 4.1.8 looks like this:
HelloPSADT\
├── Invoke-AppDeployToolkit.exe launcher called by the deployment tool
├── Invoke-AppDeployToolkit.ps1 wrapper script: the packager's work area
├── PSAppDeployToolkit\ the module, read-only (do not modify)
├── PSAppDeployToolkit.Extensions\ optional custom functions
├── Files\ installation media (MSI, EXE, MST, MSP)
├── SupportFiles\ other files needed during installation
├── Assets\ AppIcon.png, Banner.Classic.png
├── Config\ config.psd1: toolkit settings
└── Strings\ strings.psd1 plus one folder per language| Folder or file | Edited by the packager | Purpose |
|---|---|---|
Invoke-AppDeployToolkit.ps1 | Yes | Metadata and the install, uninstall and repair logic |
Invoke-AppDeployToolkit.exe | No | Starts PowerShell with the wrapper script and passes the exit code back |
Files\ | Yes | The vendor installer; $adtSession.DirFiles points here at run time |
SupportFiles\ | Yes | Configuration files, .reg files and similar; $adtSession.DirSupportFiles |
Config\, Strings\, Assets\ | Rarely | Log paths, MSI defaults, dialog texts and branding for this package |
PSAppDeployToolkit\ | Never | The module itself; the documentation says not to modify anything in it |
PSAppDeployToolkit.Extensions\ | Optional | Reusable functions; outside the scope of this course |
AppIcon.png is the dialog logo (256 × 256 PNG recommended); Banner.Classic.png is used only by the Classic dialog style. Settings in Config\config.psd1 used in this course:
| Key | 4.1.8 default | Effect |
|---|---|---|
Toolkit.LogPath | $envWinDir\Logs\Software | Log folder with administrator rights |
Toolkit.LogPathNoAdminRights | $envProgramData\Logs\Software | Log folder without administrator rights |
Toolkit.LogWriteToHost | $true | Log lines also appear in the console |
UI.DeferExitCode | 1602 | Exit code of a deferred deployment |
Inside Invoke-AppDeployToolkit.ps1
The wrapper script has the same five parts in every package. Comments of the form ## MARK: <name> label the variables block, every phase and the initialization and invocation blocks, so searching for MARK: in an editor jumps between them.
- Parameters.
-DeploymentType(Install,Uninstall,Repair; defaultInstall),-DeployMode(Auto,Interactive,NonInteractive,Silent; defaultAuto), and three switches:-SuppressRebootPassThru(exit with0instead of a reboot code such as3010),-TerminalServerMode(install mode for Remote Desktop Session Hosts),-DisableLogging. - Variables. The
$adtSessionhashtable with the package metadata. - Deployment functions.
Install-ADTDeployment,Uninstall-ADTDeploymentandRepair-ADTDeployment. - Initialization. Sets strict error handling, unblocks and imports the module from the package folder (or, if the folder is missing, an installed module with the same GUID and version 4.1.8 or later), and opens the session. If the module cannot be imported or the session cannot be opened, the script ends with exit code
60008(one exception follows under deploy modes). Not edited. - Invocation. Imports every sibling folder named
PSAppDeployToolkit.*(the extensions), calls the deployment function that matches-DeploymentType, and closes the session. An unhandled error is logged and ends the session with exit code60001. Not edited.
Deployment types and phases
Each deployment function is divided into three phases. The template sets the phase name at the start of each section, and every log line carries it; in the CMTrace log, the message starts with [Pre-Install] :: . While the session opens, the phase name is Initialization; from then until the first phase it is Execution, and Close-ADTSession switches it to Finalization.
| Deployment type | Pre phase | Main phase | Post phase |
|---|---|---|---|
| Install | Pre-Install | Install | Post-Install |
| Uninstall | Pre-Uninstall | Uninstall | Post-Uninstall |
| Repair | Pre-Repair | Repair | Post-Repair |
The phase names come from the deployment type, not from the comments. In 4.1.8 the last marker of the uninstall function reads ## MARK: Post-Uninstallation, while the phase in the log is Post-Uninstall.
The layout of the install function in the 4.1.8 template, shortened:
function Install-ADTDeployment
{
[CmdletBinding()]
param
(
)
##================================================
## MARK: Pre-Install
##================================================
$adtSession.InstallPhase = "Pre-$($adtSession.DeploymentType)"
# Template: Show-ADTInstallationWelcome, Show-ADTInstallationProgress
## <Perform Pre-Installation tasks here>
##================================================
## MARK: Install
##================================================
$adtSession.InstallPhase = $adtSession.DeploymentType
# Template: Zero-Config MSI block
## <Perform Installation tasks here>
##================================================
## MARK: Post-Install
##================================================
$adtSession.InstallPhase = "Post-$($adtSession.DeploymentType)"
## <Perform Post-Installation tasks here>
# Template: Show-ADTInstallationPrompt with a sample message
}The template is not empty. Pre-Install calls Show-ADTInstallationWelcome with -AllowDefer, -DeferTimes 3, -CheckDiskSpace and -PersistPrompt (plus -CloseProcesses when AppProcessesToClose is filled) and shows a progress dialog. Post-Install shows a sample message, which a real package removes or replaces. Pre-Uninstall and Pre-Repair close listed processes with a 60-second countdown.
$adtSession basics
At the top of the script, $adtSession is a plain hashtable. These are the fields of the 4.1.8 template:
$adtSession = @{
# App variables.
AppVendor = ''
AppName = ''
AppVersion = ''
AppArch = ''
AppLang = 'EN'
AppRevision = '01'
AppSuccessExitCodes = @(0)
AppRebootExitCodes = @(1641, 3010)
AppProcessesToClose = @() # Example: @('excel', @{ Name = 'winword'; Description = 'Microsoft Word' })
AppScriptVersion = '1.0.0'
AppScriptDate = '2000-12-31'
AppScriptAuthor = '<author name>'
RequireAdmin = $true
# Install Titles (Only set here to override defaults set by the toolkit).
InstallName = ''
InstallTitle = ''
# Script variables.
DeployAppScriptFriendlyName = $MyInvocation.MyCommand.Name
DeployAppScriptParameters = $PSBoundParameters
DeployAppScriptVersion = '4.1.8'
}| Field | Meaning |
|---|---|
AppVendor … AppRevision | Metadata; builds the install name and the log name |
AppSuccessExitCodes, AppRebootExitCodes | Exit codes that mean success, or success with a required restart |
AppProcessesToClose | New in 4.1: processes to close, used by all three deployment types |
AppScriptVersion, AppScriptDate, AppScriptAuthor | Wrapper version, date and author, written to the log; New-ADTTemplate sets the date |
RequireAdmin | New in 4.1: the session fails without administrator rights |
InstallName, InstallTitle | Empty: the toolkit builds them |
DeployAppScript* | Name, parameters and version of the wrapper; not edited |
The initialization block removes empty fields from the hashtable, passes the rest to Open-ADTSession and replaces $adtSession with a session object. From then on, $adtSession also exposes values the toolkit has worked out:
| Property | Content |
|---|---|
DeploymentType, DeployMode | What is being done, and in which mode (after the Auto decision) |
InstallPhase | The current phase, for example Pre-Install |
DirFiles, DirSupportFiles | Full paths of Files\ and SupportFiles\ in the running package |
InstallName | Built from vendor, name, version, architecture, language and revision |
InstallTitle | Built from vendor, name and version; shown in dialog titles |
LogPath, LogName | Folder and file name of the PSADT log |
InstallName is joined with underscores from AppVendor, AppName, AppVersion, AppArch, AppLang and AppRevision. Spaces and characters that are invalid in file names are removed, and empty fields are skipped. The PSADT log is then named <InstallName>_PSAppDeployToolkit_<DeploymentType>.log and written to C:\Windows\Logs\Software when the toolkit runs with administrator rights. With AppVendor = 'Igor Pavlov', AppName = '7-Zip', AppVersion = '26.06', AppArch = 'x64', AppLang = 'EN' and AppRevision = '01', an installation logs to:
C:\Windows\Logs\Software\IgorPavlov_7-Zip_26.06_x64_EN_01_PSAppDeployToolkit_Install.logWithout administrator rights, the toolkit uses C:\ProgramData\Logs\Software and appends the user name to the file name. Two packages with the same or empty metadata would write to the same log file, which is why the metadata matters.
AppName is left empty, the toolkit uses Zero-Config MSI mode: it takes an MSI from Files\, a matching MST and any MSP files, reads vendor, name and version from the MSI and installs it on its own. A package built by hand always sets AppName.
RequireAdmin = $true makes the session fail with exit code 60008 when the process is not elevated; the log starts that error with This deployment requires administrative permissions. Since 4.1, the launcher no longer elevates itself and must be run elevated, as the documentation states. Deployment tools that run as SYSTEM meet this condition; a manual test needs an elevated console.
Deploy modes
-DeployMode controls whether the user sees dialogs. The template default is Auto, with the comment "Don't hard-code this unless required."
| Mode | Behaviour in 4.1.8 |
|---|---|
Interactive | Always shows dialogs and skips the Auto checks. Fails if no user is signed in and the process is not interactive. |
NonInteractive | "Dialogs without prompts": progress dialogs appear, the welcome dialog and prompts that wait for input do not. |
Silent | No dialogs at all. |
Auto | The toolkit decides at session start, see below. |
In NonInteractive and Silent mode, Show-ADTInstallationWelcome runs silently: processes listed in AppProcessesToClose are closed without asking the user.
According to the 4.1.8 session code, Auto switches to Silent in three cases, checked in this order:
- The device has not completed the out-of-box experience, or the user account setup phase of the Enrollment Status Page is still running.
- The process runs under a system or service account (the log calls this session 0), no user is signed in, and the process is not interactive.
AppProcessesToCloselists processes and none of them is running.
Otherwise the session continues as Interactive. The log records the decision, for example Installation is running in [Silent] mode. The template's help text describes case 3 the other way round; the code switches to Silent when none of the processes is running.
-DeployMode Interactive with no signed-in user stops the session ("This deployment explicitly requires interactivity …") and returns the deferral exit code, 1602 by default. For deployments that must also run when nobody is signed in, Silent or Auto is the safer choice. This follows from the 4.1.8 source; the documentation does not describe it.
User interaction in depth (deferrals, countdowns, closing applications) is covered in the advanced course. For this course, Silent and Interactive are enough.
The launcher
Invoke-AppDeployToolkit.exe exists so that deployment tools can start the package with a plain command line. According to the 4.1.8 launcher source, it starts Windows PowerShell 5.1 in a hidden window with -ExecutionPolicy Bypass -NonInteractive -NoProfile -NoLogo and an empty PSModulePath, runs the .ps1 file with its own base name from its folder (Invoke-AppDeployToolkit.ps1) with all other arguments, waits, and returns the script's exit code.
Three launcher switches exist: /Core uses PowerShell 7 (pwsh.exe from the PATH), /32 forces 32-bit Windows PowerShell, and /Debug shows the console output; /32 and /Core together are rejected. Started from a PowerShell 7 console, the launcher uses that pwsh.exe even without /Core. If the launcher itself fails, it returns 60010 or 60011 (exit codes).
The launcher is a Windows application, not a console program, so a console does not wait for it; lessons 4 and 5 use Start-Process -Wait -PassThru.
Reboot codes and -SuppressRebootPassThru
When the installer returns a reboot code such as 3010, the package passes it on to the caller, and the deployment tool decides how to handle the restart (lesson 6). The switch -SuppressRebootPassThru changes this. The 4.1 documentation describes it in one sentence: "Suppresses return of 3010 'Reboot Required' exit codes and returns 0 instead." In 4.1.8 the switch applies to every code in AppRebootExitCodes, so 1641 also becomes 0. The deployment tool then sees a plain success and is not told that a restart is pending. The restart is still needed: Windows Installer defines 3010 as "A restart is required to complete the install". The command lines in this course leave the switch out, so that the deployment tool receives the restart code.
Common mistakes
| Symptom | Cause | Fix |
|---|---|---|
Install-Module or New-ADTTemplate fails with "running scripts is disabled on this system" | The execution policy is Restricted, the default on Windows clients; it also blocks module script files (.psm1) | Run Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force in the console. A policy set by Group Policy cannot be overridden this way |
The package ends with exit code 60008, and its log is in C:\ProgramData\Logs\Software | The console is not elevated. RequireAdmin = $true fails the deployment without administrative privileges, and the launcher does not relaunch itself elevated | Run the test from a console started as administrator |
New-ADTTemplate stops with an error instead of creating the package | The target folder exists and is not empty | Choose a new -Name, or use -Force knowing that it replaces the existing folder |
The package installs an MSI from Files\ that no line of the wrapper calls | AppName is empty, which activates zero-config mode | Set AppName (and the other metadata) in $adtSession |
Try it
The goal is a package that installs nothing, writes its own log line and exits cleanly. It is built on PKG01 and tested on CL01.
On the Hyper-V host, apply the checkpoint
psadt-L2-startofCL01and start the VM if it is off. If the checkpoint does not exist yet, applypsadt-L1-endand take it:Checkpoint-VM -Name CL01 -SnapshotName psadt-L2-start. Other hypervisors: the equivalent snapshot. Expected:CL01is in the clean state from lesson 1. Check:Get-VMCheckpoint -VMName CL01listspsadt-L2-start.On
PKG01, open Windows PowerShell, allow scripts for this console, install the module and create the package:powershell# Install PSADT and create an empty package Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force Install-Module -Name PSAppDeployToolkit -RequiredVersion 4.1.8 -Scope CurrentUser New-Item -Path 'C:\Lab\Packages' -ItemType Directory -Force | Out-Null New-ADTTemplate -Destination 'C:\Lab\Packages' -Name 'HelloPSADT'Alternatively, extract
PSAppDeployToolkit_Template_v4.zipfrom the 4.1.8 release toC:\Lab\Packages\HelloPSADTand unblock the files as shown above. On the first run,Install-Moduleasks to install the NuGet provider and to confirm the untrustedPSGalleryrepository; answerYto both (the second question defaults toN). Expected: module version 4.1.8 is installed and the package folder exists. Check:Get-Module -Name PSAppDeployToolkit -ListAvailable | Select-Object -Property Name, Versionshows4.1.8, andTest-Path -Path 'C:\Lab\Packages\HelloPSADT\Invoke-AppDeployToolkit.ps1'returnsTrue.Open
C:\Lab\Packages\HelloPSADT\Invoke-AppDeployToolkit.ps1in an editor. SetAppVendor = 'Training',AppName = 'HelloPSADT'andAppVersion = '1.0'. LeaveAppArchempty. Expected: the three fields are filled,AppArchis empty. Check:Select-String -Path 'C:\Lab\Packages\HelloPSADT\Invoke-AppDeployToolkit.ps1' -Pattern "AppName = 'HelloPSADT'" -SimpleMatchreturns the line.In
Install-ADTDeployment, below the line## <Perform Installation tasks here>, add:powershellWrite-ADTLogEntry -Message "Hello from phase [$($adtSession.InstallPhase)], files folder [$($adtSession.DirFiles)]."Save the file. Expected: the line sits in the Install part of
Install-ADTDeployment. Check:Select-String -Path 'C:\Lab\Packages\HelloPSADT\Invoke-AppDeployToolkit.ps1' -Pattern 'Hello from phase' -SimpleMatchreturns one line.Copy the folder
C:\Lab\Packages\HelloPSADTfromPKG01to the same path onCL01.CL01needs neither the module nor a changed execution policy, because the package carries its own copy of the module. Expected: the package is onCL01. Check: onCL01,Test-Path -Path 'C:\Lab\Packages\HelloPSADT\PSAppDeployToolkit'returnsTrue.On
CL01, open Windows PowerShell as administrator and run the package silently:powershell# Run the wrapper script directly in a child Windows PowerShell process Set-Location -Path 'C:\Lab\Packages\HelloPSADT' powershell.exe -ExecutionPolicy Bypass -NoProfile -File .\Invoke-AppDeployToolkit.ps1 -DeploymentType Install -DeployMode Silent "Exit code: $LASTEXITCODE"Expected: the console shows the log lines while the script runs and ends with
Exit code: 0.Open the newest log in
C:\Windows\Logs\Softwarewith Notepad or CMTrace. Expected: the fileTraining_HelloPSADT_1.0_EN_01_PSAppDeployToolkit_Install.logexists. It containsInstallation is running in [Silent] mode., the custom line with the phaseInstalland the full path of theFilesfolder, and a final line[Training_HelloPSADT_1.0_EN_01] install completed in [...] seconds with exit code [0].Check:Select-String -Path 'C:\Windows\Logs\Software\Training_HelloPSADT_1.0_EN_01_PSAppDeployToolkit_Install.log' -Pattern 'Hello from phase [Install]' -SimpleMatchreturns the custom line.Optional: repeat step 6 from a console on
CL01that is not elevated. This needs an account that is a local administrator onCL01but is not the built-in Administrator: with the built-in account, Windows starts every console elevated by default, and in the lab the domain accountCORP\Administratorbehaved the same way. Starting the console withrunasas a different user does not reproduce this case either: in the lab, a run started withrunasas a user who was not an administrator onCL01also ended with60008, but wrote no log. Expected: exit code60008; the log is inC:\ProgramData\Logs\Software, with the user name at the end of the file name. Check:Get-ChildItem -Path 'C:\ProgramData\Logs\Software' -Filter 'Training_HelloPSADT*'.On the host, revert
CL01topsadt-L2-start, then take the checkpointpsadt-L2-end. The package stays onPKG01for lesson 3. Expected:CL01is clean again. Check:Get-VMCheckpoint -VMName CL01listspsadt-L2-end.
Check your understanding
- Which two parts of a PSADT package does a packager work with, and which folder is never edited?
Answer
The packager edits Invoke-AppDeployToolkit.ps1 and places the installer in Files\. The PSAppDeployToolkit\ module folder is never edited; New-ADTTemplate marks it read-only, and the documentation says not to modify anything in it.
- What are the three phases of the Uninstall deployment type, as written to the log?
Answer
Pre-Uninstall, Uninstall and Post-Uninstall.
- A package has
AppVendor = 'Example',AppName = 'Example App',AppVersion = '2.1',AppArch = '',AppLang = 'EN',AppRevision = '01'. What is the name of the PSADT log for an uninstall run with administrator rights?
Answer
Example_ExampleApp_2.1_EN_01_PSAppDeployToolkit_Uninstall.log. Spaces are removed and the empty architecture field is skipped.
- A package lists
7zFMinAppProcessesToCloseand runs with the default deploy mode while 7-Zip is not open. Which mode does the session choose?
Answer
Silent. In Auto mode, 4.1.8 switches to silent when processes to close are defined but none of them is running.
- Why does a manual test of a package need an elevated console?
Answer
The template sets RequireAdmin = $true, and since 4.1 the launcher no longer elevates itself. A non-elevated run fails at session start with exit code 60008.
- A package runs with
-DeployMode NonInteractivewhile a user is signed in. Which dialogs appear, and how does an explicit-DeployMode Interactivebehave on a device where nobody is signed in?
Answer
In NonInteractive mode, only non-interactive elements such as progress dialogs appear; the welcome dialog and prompts that wait for input are skipped, and listed processes are closed without asking. An explicit Interactive run with no signed-in user stops in 4.1.8 and returns the deferral exit code, 1602 by default, which is why Silent or Auto suits deployments that also run when nobody is signed in.
Summary
- PSADT 4.1.8 comes from the PowerShell Gallery (
Install-Module -Name PSAppDeployToolkit -RequiredVersion 4.1.8) or as template ZIPs from the GitHub releases; on Windows clients, scripts must first be allowed for the session. New-ADTTemplatecreates a self-contained package: wrapper script, launcher,Files\,SupportFiles\,Assets\,Config\,Strings\and a read-only copy of the module.Invoke-AppDeployToolkit.ps1holds one function per deployment type, each with a Pre, main and Post phase; initialization and invocation are not edited.$adtSessionstarts as metadata and becomes the session object; its fields decide the install name and the log file name.Autolets the toolkit choose the deploy mode;SilentandInteractivefix it, with the caveat thatInteractiveneeds a signed-in user.- The launcher starts Windows PowerShell 5.1 and does not elevate itself;
-SuppressRebootPassThruturns a reboot code such as3010into0, so the deployment tool no longer learns about a pending restart.
Sources
- PSAppDeployToolkit 4.1 — Download — https://psappdeploytoolkit.com/docs/4.1.x/getting-started/download (link from the lesson text; to be checked in stage 7)
- PSAppDeployToolkit 4.1 — Creating a new deployment — https://psappdeploytoolkit.com/docs/4.1.x/getting-started/creating-a-new-deployment (4.1.x)
- PSAppDeployToolkit 4.1 — New-ADTTemplate — https://psappdeploytoolkit.com/docs/4.1.x/reference/functions/New-ADTTemplate (4.1.x, checked 2026-11-30)
- PSAppDeployToolkit 4.1 — Deployment structure — https://psappdeploytoolkit.com/docs/4.1.x/deployment-concepts/deployment-structure (4.1.x)
- PSAppDeployToolkit 4.1 — Invoke-AppDeployToolkit — https://psappdeploytoolkit.com/docs/4.1.x/deployment-concepts/invoke-appdeploytoolkit (4.1.x, checked 2026-11-30)
- PSAppDeployToolkit 4.1 — How to deploy — https://psappdeploytoolkit.com/docs/4.1.x/usage/how-to-deploy (4.1.x, checked 2026-11-30)
- PSAppDeployToolkit 4.1 — Zero-config deployment — https://psappdeploytoolkit.com/docs/4.1.x/deployment-concepts/zero-config-deployment (4.1.x, checked 2026-11-30)
- PSAppDeployToolkit 4.1 — Exit codes — https://psappdeploytoolkit.com/docs/4.1.x/reference/exit-codes (4.1.x, checked 2026-11-30)
- PSAppDeployToolkit release 4.1.8 — https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/releases/tag/4.1.8 (released 2026-01-14)
- about_Execution_Policies (Windows PowerShell 5.1) — https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-5.1 (ms.date 2026-08-31, checked 2026-11-30)
- Install PowerShellGet on Windows PowerShell 5.1 — https://learn.microsoft.com/en-us/powershell/gallery/powershellget/install-powershellget (link from the lesson text; to be checked in stage 7)
- Import-Module (Windows PowerShell 5.1), parameter -FullyQualifiedName — https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/import-module?view=powershell-5.1 (ms.date 2024-06-07, checked 2026-11-30)
- PSAppDeployToolkit 4.1.8 source code (
DeploymentSession.cs,Open-ADTSession.ps1,New-ADTEnvironmentTable.ps1) — https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/tree/4.1.8 (tag 4.1.8, checked 2026-11-30) - MsiExec.exe and InstMsi.exe error messages — https://learn.microsoft.com/en-us/windows/win32/msi/error-codes (ms.date 2023-02-08, checked 2026-11-30)
- KB5137172: Windows PowerShell 5.1 deprecation — https://support.microsoft.com/en-us/servicing/os/windows/docs/2026/11/kb5137172-windows-powershell-5-1-deprecation (November 2026; link from the lesson text)