Close-ADTSession -ExitCode 3010 not working

I’m deploying Windows Sandbox but I only want it to generate a reboot if the feature is successfully installed.
At the end of the function Install-ADTDeployment I have this:

if($Sandbox_Status -eq $true)
{
	Write-ADTLogEntry -Message "ExitCode set to 3010" -Source "$($adtSession.InstallPhase)" -Severity 2 -LogType CMTrace
    Close-ADTSession -ExitCode 3010
}
Show-ADTInstallationPrompt -Message 'Install Complete.' -ButtonRightText 'OK' -Icon Information -NoWait

My command line in ConfigMgr is this:

"Invoke-AppDeployToolkit.exe" -DeploymentType "Install" -DeployMode "Silent" -AllowRebootPassThru

I can see with in the log that it is hitting that section and should be returning a 3010 but I’m not getting the reboot request in ConfigMgr and the app is showing as a failure (which makes sense because it’s on the reboot the feature is actually added/removed.

I just found that this has been reported as a bug and will be fixed in version 4.0.5

2 Likes