PSAppDeployToolkit / PSAppDeployToolkit/website

[Feature] Provide a way to only enable SuppressRebootPassThru when running in a Task Sequence

Open
#188 2 comments 0 reactions 1 assignee View on GitHub

@DanGough is already working on this.

Since Jun 29, 2026.

Dominant language
MDX
Stars
5
Forks
7
Avg merge
3h 46m
Merged PRs (30d)
5

Description

Summary of the new feature / enhancement

You would normally want 3010 exit codes to be reported to the deployment system so that they can advise the user a reboot is required. This is fine since those requests can be ignored and acted upon later.

However a task sequence reboots instantly when it gets a 3010 from an application install.

It's not possible to change the SuppressRebootPassThru property of the session after it's been opened, nor is there a public command for determining if we're in a TS that we can use to work out if SuppressRebootPassThru should be enabled before opening the session.

Proposed technical implementation details (optional)

So one way to make this easier would be to change this to a read/write property. This would still need some custom code in the template to achieve the desired outcome, so it would be nicer still if there was a dedicated switch for it, either by making SuppressRebootPassThru an enum to support a 3rd option, or a new switch e.g. -SuppressRebootPassThruInTaskSequence.

For now, one way of achieving this is to place this code before Exit-ADTSession in the current template:

if ($RunningTaskSequence -and $adtSession.GetExitCode() -eq '3010')
{
    Write-ADTLogEntry -Message 'Supressing reboot due to running task sequence.'
    $adtSession.SetExitCode(0)
}

You could also modify the template to set SuppressRebootPassThru dependent on if we are in a TS (this is the method PSADT uses to set the $RunningTaskSequence variable):

SuppressRebootPassThru = (!![System.Type]::GetTypeFromProgID('Microsoft.SMS.TSEnvironment'))

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.