- Write the install, uninstall and repair command lines for a PSADT package
- Choose the deploy mode and install context for ConfigMgr and Intune
- Configure an MSI product code detection rule and explain the script detection rules
- Name the settings to verify on a ConfigMgr deployment type and an Intune Win32 app
- Find the client logs that show the result of the first deployment
The package from lessons 4 and 5 is tested and documented. What remains is the handover: the deployment tool needs the package folder, the command lines and a rule that tells it whether the application is installed. This lesson covers that handover for Configuration Manager and for Intune at an overview level, with the settings that matter for a PSADT package. The detailed walkthroughs are linked at the end.
What is handed over
The deployment tool receives two things:
- The package folder, unchanged after testing. In Configuration Manager it is the content source of the deployment type. For Intune it is converted into a single
.intunewinfile. - A handover sheet with the values the tool needs. The exercise at the end of this lesson produces one.
The package must not be edited after the tests. Any change, even a corrected comment, means a new revision and a new test cycle.
Command lines
Both tools call the launcher, not the wrapper script:
Install: Invoke-AppDeployToolkit.exe -DeploymentType Install -DeployMode Silent
Uninstall: Invoke-AppDeployToolkit.exe -DeploymentType Uninstall -DeployMode Silent
Repair: Invoke-AppDeployToolkit.exe -DeploymentType Repair -DeployMode SilentCalling the .exe has three effects, as described in lesson 2: it starts Windows PowerShell with -ExecutionPolicy Bypass in a hidden window, it runs the wrapper from the package folder, and it passes the wrapper's exit code back to the deployment tool.
Both parameters are optional in the 4.1.8 template. Without -DeploymentType, the wrapper runs Install; without -DeployMode, it runs in Auto mode and decides at session start (lesson 2). The command lines in this course state both values, so the handover sheet shows exactly what runs.
powershell.exe starts 32-bit PowerShell, as the Win32 app documentation states. 64-bit PowerShell needs %SystemRoot%\Sysnative\WindowsPowerShell\v1.0\powershell.exe. The launcher avoids the question: according to its 4.1.8 project file it is an AnyCPU .NET program, so it runs as a 64-bit process on 64-bit Windows, and it starts WindowsPowerShell\v1.0\PowerShell.exe from the system directory of that process.
-ExecutionPolicy Bypass has one documented limit. According to about_Execution_Policies, an execution policy set on the command line applies to the process scope and does not take precedence over a policy set by Group Policy. If devices receive Turn on Script Execution through Group Policy, the package must meet that policy; under AllSigned, for example, the wrapper script itself needs a trusted signature. Code signing is part of the advanced course.
Which deploy mode
For a first package, -DeployMode Silent is the predictable choice in both tools:
- Intune. Microsoft states that Intune "does not support interactive application installations" and that tools such as
serviceui.exethat force interaction are unsupported. PSADT 4.1 shows dialogs from SYSTEM without ServiceUI, according to its 4.1.0 release notes, but that is not a configuration Microsoft supports for Intune. How PSADT dialogs relate to this statement, and how deferrals are set up for Intune with-DeferRunInterval, is the subject of module PS-M10 (Intune integration) of the advanced course. - Configuration Manager. Interactive deployments are possible and common, for example an available deployment in Software Center with a welcome dialog. Since PSADT 4.1.0, the option Allow users to view and interact with the program installation is no longer required for the dialogs, according to the release notes. As lesson 2 showed,
-DeployMode Interactivefails with1602in 4.1.8 when nobody is signed in, so it does not suit a required deployment that also runs at night.
User-facing deployments with dialogs, deferrals and restart prompts are covered in depth in the advanced course.
Detection
A detection rule tells the deployment tool, on each device, whether the application is installed. The tool checks it before the installation, to skip devices that already have the application, and after the installation, to confirm the result. A package that returns 0 but whose detection rule then finds nothing is not reported as installed; for a required app, Intune offers the app again within about 24 hours, according to the Win32 app documentation.
For an MSI package, the MSI product code is the simplest rule and the one this course uses. Both tools offer it as a rule type:
| Tool | Where | Value |
|---|---|---|
| Configuration Manager | Detection Method, Add Clause, Setting Type Windows Installer | The product code from lesson 4, step 3; Browse can read it from the MSI in Files\ |
| Intune | Detection rules, Manually configure detection rules, Rule type MSI | The same product code, typed in; MSI product version check optional |
For Intune, the product code is typed in. Microsoft documents that the Content Prep Tool retrieves the MSI information Intune needs when the setup file is an MSI; for a PSADT package the setup file is the launcher, so Notes.md is the source.
Registry and file rules are the usual alternatives for EXE installers. Script rules are the most flexible and have a precise contract, documented on Microsoft Learn for both tools:
| Script outcome | Configuration Manager | Intune |
|---|---|---|
Exit code 0, output on STDOUT, STDERR empty | Installed | Installed |
Exit code 0, STDOUT empty | Not installed (STDERR empty) or unknown (STDERR not empty) | Not installed |
Exit code 0, output on STDOUT and on STDERR | Installed | Not installed |
Exit code not 0 | Unknown | Not installed |
The sources are the detection sections of Create applications for Configuration Manager and of Add and assign Win32 apps for Intune. A script rule must therefore write something to STDOUT when the application is found and must not write to STDERR. Detection strategies beyond the product code are part of the advanced course.
Configuration Manager
The ConfigMgr deployment article on the blog covers each tab in detail. For a first package, these settings are the ones to check:
| Setting | Value for this package |
|---|---|
| Application | Manually specify the application information; name, publisher and version from the notes |
| Deployment type | Script Installer |
| Content location | UNC path of the Package folder; the site server's computer account needs read access |
| Installation program | Invoke-AppDeployToolkit.exe -DeploymentType Install -DeployMode Silent |
| Uninstall program | Invoke-AppDeployToolkit.exe -DeploymentType Uninstall -DeployMode Silent |
| Repair program | Invoke-AppDeployToolkit.exe -DeploymentType Repair -DeployMode Silent; in the lab run with version 2603, the create wizard showed no repair field, and the value was set afterwards in the deployment type properties, Programs tab |
| Run installation and uninstall program as 32-bit process on 64-bit clients | Off |
| Detection method | Windows Installer, product code |
| Installation behavior | Install for system (in the lab run with version 2603, a new Script Installer deployment type started with Install for user) |
| Logon requirement | Whether or not a user is logged on (the default is Only when a user is logged on) |
| Allow users to view and interact with the program installation | Off; not needed for PSADT dialogs since 4.1.0 |
| Maximum allowed run time | Default 120 minutes is sufficient |
| Post-installation behavior | Determine behavior based on return codes |
Create applications on Microsoft Learn lists the default return codes of a Script Installer deployment type as 0 (Success (no reboot)), 1641 (Hard Reboot), 3010 (Soft Reboot) and 1618 (Fast Retry). In the lab run with version 2603, the console also added 1707 (Success (no reboot)), which Learn lists only for Windows Installer deployment types. These cover the success and reboot codes of this package. Because the command lines leave out -SuppressRebootPassThru (lesson 2), a 3010 from the MSI reaches Configuration Manager as Soft Reboot instead of being turned into 0. For Fast Retry, the client retries every two hours, up to 10 times; PSADT itself returns 1618 when a dialog times out (lesson 5). Any other non-zero code, such as 1603 or 60001, counts as a failure unless it is added on the Return Codes tab. The content is then distributed to a distribution point and the application deployed to a small test collection.
A deferral is not part of this package, because it runs with -DeployMode Silent. A package that offers Defer ends with 1602 (lesson 5), which is not in the default list. The PSADT FAQ suggests setting DeferExitCode in config.psd1 to 1618 for Configuration Manager, so that a deferral triggers Fast Retry. Deferrals, countdowns and the matching exit codes are covered in module PS-M04 (User experience) of the advanced course.
Intune
The Intune route adds one preparation step. The Microsoft Win32 Content Prep Tool packs the package folder into an .intunewin file:
REM Convert the PSADT package folder into an .intunewin file
IntuneWinAppUtil.exe -c "C:\Lab\Packages\7-Zip\26.06\Package" -s "C:\Lab\Packages\7-Zip\26.06\Package\Invoke-AppDeployToolkit.exe" -o "C:\Lab\Intune\7-Zip\26.06" -q-c is the folder whose complete content is packed, -s the setup file inside it, given as a full path as in the Microsoft example, -o the output folder, and -q quiet mode. In quiet mode there are no prompts, an existing output file is overwritten, and a missing output folder is created. The tool itself must not be inside the -c folder, because everything in that folder ends up in the file. The tool is a download from the Microsoft-Win32-Content-Prep-Tool repository on GitHub (version 1.8.7 on 2026-11-30); IntuneWinAppUtil.exe -v shows the version.
Check: the output folder contains one .intunewin file with a current time stamp. This file is uploaded on the App package file page of the Win32 app.
| Setting | Value for this package |
|---|---|
| App type | Windows app (Win32) |
| Installer type | Command line |
| Install command | Invoke-AppDeployToolkit.exe -DeploymentType Install -DeployMode Silent |
| Uninstall command | Invoke-AppDeployToolkit.exe -DeploymentType Uninstall -DeployMode Silent |
| Install behavior | System |
| Installation time required | Default 60 minutes is sufficient |
| Device restart behavior | Determine behavior based on return codes |
| Return codes | Intune adds a list by default; confirm 0 Success, 3010 Soft reboot, 1641 Hard reboot and 1618 Retry, and add any that are missing |
| Detection rule | MSI, product code |
| Assignment | Required or Available for enrolled devices to a small test group |
Intune has no logon requirement setting; the Win32 app documentation states that users do not need to be signed in for a Win32 app to install. It also describes the restart options: with Determine behavior based on return codes, a Hard reboot code restarts the device immediately and a Soft reboot code only notifies the user. A Retry code makes the agent try three times, five minutes apart. The documentation does not list the values of the default return codes, so the check above is worth the minute it takes.
Intune also offers a PowerShell script installer type for Win32 apps. How it relates to PSADT packages is described in PowerShell Script Installers for Intune Win32 Apps. For a first package, the command line installer type is sufficient.
What to verify after the first deployment
The first deployment to a test device or test group closes the loop. Three places show the result.
| Where | Configuration Manager | Intune |
|---|---|---|
| Client logs of the tool | C:\ (install and uninstall: command line, exit code), AppDiscovery.log (detection) | C:\ (Win32 app check-in, install, detection); IntuneManagementExtension.log (agent check-in and policy) |
| PSADT log | C:\ | Same path and name |
| Console | Monitoring > Deployments; Software Center on the client | Apps > All apps, the app, Monitor > Device install status |
The log descriptions follow the ConfigMgr log files reference and the Intune management extension page. CMTrace from lesson 3 reads both.
A useful order: the tool's log first, to see the command line it ran and the exit code it received; then the PSADT log, to see what happened inside the package. If the exit code is 0 but the tool reports a failure, the detection rule is the first suspect. The PSADT log also shows the deploy mode the session chose, in Installation is running in [Silent] mode., and the account it ran under, in Current User is [NT AUTHORITY\SYSTEM]. A line starting with Session 0 detected shows that the toolkit runs under a system or service account.
Common mistakes
| Symptom | Cause | Fix |
|---|---|---|
The tool reports a failure, but the PSADT log ends with exit code 0 | The detection rule does not find the application after the installation; Intune reports "Application installation succeeded but application is not detected". A likely cause is a product code from a different build | Take the product code from the MSI in Files\ (Notes.md) and correct the rule |
| A ConfigMgr script detection rule returns Unknown | The script exits with a non-zero value; ConfigMgr then reports the detection status as Unknown | End the script with exit code 0 and write to STDOUT only when the application is found |
An Intune detection script writes to STDOUT and exits with 0, but the app counts as not installed | Any data on STDERR makes Intune evaluate the result as not installed | Remove output to STDERR, including warnings and errors from commands in the script |
An Intune command line that calls powershell.exe runs in 32-bit PowerShell | Intune launches a 32-bit PowerShell for powershell.exe in the install and uninstall command | Call Invoke-AppDeployToolkit.exe, or use %SystemRoot%\ |
A ConfigMgr deployment reports a failure with 1602 after a user deferred | 1602 is not in the default return codes of a Script Installer deployment type | Set DeferExitCode to 1618 for ConfigMgr; details in module PS-M04 of the advanced course |
Try it
The exercise produces a handover sheet. With a lab, it continues to a real test deployment.
On the Hyper-V host, apply the checkpoint
psadt-L6-startofCL01and start the VM if it is off. If the checkpoint does not exist yet, applypsadt-L5-endand take it:Checkpoint-VM -Name CL01 -SnapshotName psadt-L6-start. Other hypervisors: the equivalent snapshot.CL01serves as the test device in steps 3 to 6 if it is a Configuration Manager client or enrolled in the Intune test tenant. Expected:CL01is clean. Check:Get-VMCheckpoint -VMName CL01listspsadt-L6-start.On
PKG01, createC:\Lab\Packages\7-Zip\26.06\Handover.mdwith the following content, and fill in the product code fromNotes.md:textApplication: 7-Zip 26.06 x64 Publisher: Igor Pavlov Version: 26.06 PSADT version: 4.1.8 Package revision: 01 Content: \\<server>\<share>\7-Zip\26.06\Package Install command: Invoke-AppDeployToolkit.exe -DeploymentType Install -DeployMode Silent Uninstall command: Invoke-AppDeployToolkit.exe -DeploymentType Uninstall -DeployMode Silent Repair command: Invoke-AppDeployToolkit.exe -DeploymentType Repair -DeployMode Silent Install context: System, whether or not a user is logged on Detection: MSI product code {........-....-....-....-............} Return codes: 0 success, 3010 soft reboot, 1641 hard reboot, 1618 retry PSADT log: C:\Windows\Logs\Software\IgorPavlov_7-Zip_26.06_x64_EN_01_PSAppDeployToolkit_<Type>.log Tested on: <OS version>, <date>, test cycle from lesson 5 passedThen close the open line of the pre-handover checklist in
Notes.md: the command lines are now written down. Expected: the sheet holds every value the deployment tool asks for, with no value that has to be looked up again. Check: the product code inHandover.mdequals the one inNotes.md:Select-String -Path 'C:\Lab\Packages\7-Zip\26.06\Handover.md', 'C:\Lab\Packages\7-Zip\26.06\Notes.md' -Pattern '\{[0-9A-F-]{36}\}'shows the same product code in both files;Notes.mdalso lists the upgrade code, which the pattern matches as well.With a Configuration Manager lab (optional): copy the
Packagefolder to the content share, create the application and deployment type with the values from the sheet, distribute the content, and deploy it as Required to a collection with one test device. Expected: the console reports the application as installed on the test device.With an Intune test tenant (optional): create the
.intunewinfile, add a Win32 app with the values from the sheet, and assign it as Required to a group with one test device. Expected: the output folder holds one.intunewinfile, and Device install status reports the app as installed on the test device.With a lab (optional): on the test device, after the installation, open the tool's client log and the PSADT log. Expected:
AppEnforce.logorAppWorkload.logshows the install command line and exit code0; the PSADT log ends withinstall completed in [...] seconds with exit code [0]and showsInstallation is running in [Silent] mode.With a lab (optional): change the assignment or deployment to uninstall, and confirm the removal in the same logs. Expected: the uninstall leaves no 7-Zip entry in the uninstall registry. Check: the registry query from lesson 1, step 6, returns nothing.
On the host, revert
CL01topsadt-L6-start, then take the checkpointpsadt-L6-end. Expected:CL01is clean; the package,Notes.mdandHandover.mdare onPKG01. Check:Get-VMCheckpoint -VMName CL01listspsadt-L6-end.
Check your understanding
- Why do the command lines call
Invoke-AppDeployToolkit.exerather thanpowershell.exewith the wrapper script?
Answer
The launcher starts Windows PowerShell with the right parameters, runs the wrapper from the package folder and passes the exit code back. In Intune, a direct powershell.exe call in the command line starts 32-bit PowerShell, which the launcher avoids.
- Which deploy mode suits a required Intune deployment, and why?
Answer
Silent. Microsoft documents that Intune does not support interactive application installations, and a silent package does not depend on a signed-in user.
- A detection script writes
Installedto STDOUT, also writes a warning to STDERR, and exits with0. How do ConfigMgr and Intune evaluate it?
Answer
Configuration Manager reports the application as installed. Intune evaluates the result as not installed, because any data on STDERR makes the detection fail there.
- The tool reports a failure, but the PSADT log ends with exit code
0. What is checked first?
Answer
The detection rule. The package succeeded, but the rule did not find the application afterwards, for example because of a wrong product code or a rule for a different build.
- A required ConfigMgr deployment returns
1618. What does the client do, and what happens in Intune when1618is listed as a Retry code?
Answer
1618 is a Fast Retry code in the Script Installer defaults: the ConfigMgr client retries every two hours, up to 10 times. In Intune, a Retry code makes the agent try three times, five minutes apart. In both tools it means that another installation was running, or, from PSADT, that a dialog timed out.
- For the ConfigMgr deployment type of this package, which installation behavior and logon requirement are set, how does the logon requirement differ from the default, and which client log shows the command line and exit code of the first installation? Which log has this role for Intune?
Answer
Install for system and Whether or not a user is logged on; the default logon requirement is Only when a user is logged on, which would hold back a required deployment on a device without a signed-in user. AppEnforce.log records the enforcement actions, install and uninstall, of applications on the client. For Intune, AppWorkload.log in C:\ProgramData\Microsoft\IntuneManagementExtension\Logs covers Win32 app deployment activities.
Summary
- The tested package folder and a handover sheet are what the deployment tool receives; the package is not edited after testing.
- Both tools call
Invoke-AppDeployToolkit.exewith-DeploymentTypeand, for a first package,-DeployMode Silent. - The MSI product code is the detection rule for this package; script rules need STDOUT output, exit code
0, and in Intune an empty STDERR. - ConfigMgr needs a Script Installer deployment type running as system, whether or not a user is logged on; Intune needs an
.intunewinfile and a Win32 app with System install behavior. - Return codes decide how each tool reacts: success, soft or hard reboot, retry, or failure; the default lists are checked, not assumed.
- After the first deployment, the tool's client log and the PSADT log together explain the result.
Sources
- 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 — FAQ (deferral exit code, Fast Retry) — https://psappdeploytoolkit.com/docs/4.1.x/getting-started/faq (4.1.x, checked 2026-11-30)
- PSAppDeployToolkit 4.1.0 release notes — https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/releases/tag/4.1.0 (released 2025-08-07, checked 2026-11-30)
- Create applications (Configuration Manager) — https://learn.microsoft.com/en-us/intune/configmgr/apps/deploy-use/create-applications (ms.date 2021-10-01, updated 2026-08-31, checked 2026-11-30)
- Log file reference (Configuration Manager) — https://learn.microsoft.com/en-us/intune/configmgr/core/plan-design/hierarchy/log-files (ms.date 2025-08-11, checked 2026-11-30)
- Add and assign Win32 apps to Microsoft Intune — https://learn.microsoft.com/en-us/intune/app-management/deployment/add-win32 (ms.date 2026-11-11, checked 2026-11-30)
- Prepare Win32 app content for upload — https://learn.microsoft.com/en-us/intune/app-management/deployment/create-win32-package (link from the lesson text; to be checked in stage 7)
- App installation error codes for Microsoft Intune — https://learn.microsoft.com/en-us/troubleshoot/mem/intune/app-management/app-install-error-codes (ms.date 2026-03-30, checked 2026-11-30)
- PSAppDeployToolkit 4.1.8 source code (
DeploymentSession.cs,New-ADTEnvironmentTable.ps1) — https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/tree/4.1.8 (tag 4.1.8, checked 2026-11-30) - Microsoft Win32 Content Prep Tool — https://github.com/microsoft/Microsoft-Win32-Content-Prep-Tool (version 1.8.7 on 2026-11-30)
- Understand Microsoft Intune Management Extension — https://learn.microsoft.com/en-us/intune/device-management/tools/management-extension-windows (ms.date 2026-11-11, checked 2026-11-30)
- 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)
Where to go next
This is where the free course ends. The package built here installs, uninstalls and repairs one MSI, is tested on a clean VM, and is ready for a deployment tool. The following articles go further on the topics touched in the course:
- Creating a PSADT 4 Package: A 7-Zip Walkthrough: the same application with more steps, including signing the launcher
- PSADT 4 Application Deployment in ConfigMgr: every deployment type tab, the enforcement flow and the client logs
- PowerShell Script Installers for Intune Win32 Apps: the script installer type and three layouts for PSADT packages
- PSADT 4.2 RC2 for ConfigMgr and Intune Packagers: what changes for existing 4.1 wrappers with the next version
- Windows PowerShell 5.1 Is Deprecated: what KB5137172 means for PSADT, ConfigMgr and Intune scripts
A deeper course for supporters, covering EXE installers, user context, user interaction, upgrades, detection strategies and troubleshooting, is in preparation.