When using Show-ADTInstallationWelcome and the timeout expires without any user interaction, instead of returning 1618 the toolkit crashes with the below trace. Happens with multiple executables, when triggering via a local admin or system (via ConfigMgr) account.
Trace:
[Pre-Install] :: Checking for running processes: ['T2Txp'] Get-ADTRunningProcesses 2025-12-16 3:09:43 PM 33948 (0x849C)
[Pre-Install] :: The following processes are running: ['T2Txp']. Get-ADTRunningProcesses 2025-12-16 3:09:43 PM 33948 (0x849C)
[Pre-Install] :: Instantiating user client/server process. Invoke-ADTClientServerOperation 2025-12-16 3:09:43 PM 33948 (0x849C)
[Pre-Install] :: Prompting the user to close application(s) ['WKCA:T2Txp']... Show-ADTInstallationWelcome 2025-12-16 3:09:43 PM 33948 (0x849C)
[Pre-Install] :: Exception calling "ShowCloseAppsDialog" with "2" argument(s): "The client process returned an exception."
Error Record:
-------------
Message : Exception calling "ShowCloseAppsDialog" with "2" argument(s): "The client process returned an exception."
InnerException : PSADT.ClientServer.ServerException: The client process returned an exception. ---> System.InvalidCastException: Specified cast is not valid.
at PSADT.UserInterface.DialogManager.<>c__DisplayClass8_0`1.<ShowModalDialog>b__0() in D:\a\PSAppDeployToolkit\PSAppDeployToolkit\src\PSADT\PSADT.UserInterface\DialogManager.cs:line 243
at System.Windows.Threading.DispatcherOperation`1.InvokeDelegateCore()
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout)
at System.Windows.Threading.Dispatcher.Invoke[TResult](Func`1 callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
at System.Windows.Threading.Dispatcher.Invoke[TResult](Func`1 callback)
at PSADT.UserInterface.DialogManager.InvokeDialogAction[TResult](Func`1 callback) in D:\a\PSAppDeployToolkit\PSAppDeployToolkit\src\PSADT\PSADT.UserInterface\DialogManager.cs:line 355
at PSADT.UserInterface.DialogManager.ShowCloseAppsDialog(DialogStyle dialogStyle, CloseAppsDialogOptions options, CloseAppsDialogState state) in D:\a\PSAppDeployToolkit\PSAppDeployToolkit\src\PSADT\PSADT.UserInterface\DialogManager.cs:line 70
at PSADT.ClientServer.ClientExecutable.ShowModalDialog(IReadOnlyDictionary`2 arguments, BaseState closeAppsDialogState, String[] argv) in D:\a\PSAppDeployToolkit\PSAppDeployToolkit\src\PSADT\PSADT.ClientServer.Client\ClientExecutable.cs:line 580
at PSADT.ClientServer.ClientExecutable.EnterClientServerMode(ReadOnlyDictionary`2 arguments) in D:\a\PSAppDeployToolkit\PSAppDeployToolkit\src\PSADT\PSADT.ClientServer.Client\ClientExecutable.cs:line 344
--- End of inner exception stack trace ---
at PSADT.ClientServer.ServerInstance.Invoke[T](String command) in D:\a\PSAppDeployToolkit\PSAppDeployToolkit\src\PSADT\PSADT.ClientServer.Server\ServerInstance.cs:line 622
at CallSite.Target(Closure , CallSite , Object , String , Object , Object )
FullyQualifiedErrorId : ServerException,Show-ADTInstallationWelcome
ScriptStackTrace : at Private:Invoke-ADTClientServerOperation, C:\Temp\T22025.2\Ready_v4\PSAppDeployToolkit\PSAppDeployToolkit.psm1: line 1337
at Show-ADTWelcomePrompt, C:\Temp\T22025.2\Ready_v4\PSAppDeployToolkit\PSAppDeployToolkit.psm1: line 19562
at Show-ADTInstallationWelcome<Process>, C:\Temp\T22025.2\Ready_v4\PSAppDeployToolkit\PSAppDeployToolkit.psm1: line 19863
at Install-ADTDeployment, C:\Temp\T22025.2\Ready_v4\Invoke-AppDeployToolkit.ps1: line 130
at <ScriptBlock>, C:\Temp\T22025.2\Ready_v4\Invoke-AppDeployToolkit.ps1: line 284
at <ScriptBlock>, <No file>: line 1
PositionMessage : At C:\Temp\T22025.2\Ready_v4\Invoke-AppDeployToolkit.ps1:130 char:5
+ Show-ADTInstallationWelcome -CloseProcesses 'T2Txp'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Show-ADTInstallationWelcome 2025-12-16 3:10:14 PM 33948 (0x849C)
[Pre-Install] :: An unhandled error within [Invoke-AppDeployToolkit.ps1] has occurred.
Error Record:
-------------
Message : Exception calling "ShowCloseAppsDialog" with "2" argument(s): "The client process returned an exception."
InnerException : PSADT.ClientServer.ServerException: The client process returned an exception. ---> System.InvalidCastException: Specified cast is not valid.
at PSADT.UserInterface.DialogManager.<>c__DisplayClass8_0`1.<ShowModalDialog>b__0() in D:\a\PSAppDeployToolkit\PSAppDeployToolkit\src\PSADT\PSADT.UserInterface\DialogManager.cs:line 243
at System.Windows.Threading.DispatcherOperation`1.InvokeDelegateCore()
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout)
at System.Windows.Threading.Dispatcher.Invoke[TResult](Func`1 callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
at System.Windows.Threading.Dispatcher.Invoke[TResult](Func`1 callback)
at PSADT.UserInterface.DialogManager.InvokeDialogAction[TResult](Func`1 callback) in D:\a\PSAppDeployToolkit\PSAppDeployToolkit\src\PSADT\PSADT.UserInterface\DialogManager.cs:line 355
at PSADT.UserInterface.DialogManager.ShowCloseAppsDialog(DialogStyle dialogStyle, CloseAppsDialogOptions options, CloseAppsDialogState state) in D:\a\PSAppDeployToolkit\PSAppDeployToolkit\src\PSADT\PSADT.UserInterface\DialogManager.cs:line 70
at PSADT.ClientServer.ClientExecutable.ShowModalDialog(IReadOnlyDictionary`2 arguments, BaseState closeAppsDialogState, String[] argv) in D:\a\PSAppDeployToolkit\PSAppDeployToolkit\src\PSADT\PSADT.ClientServer.Client\ClientExecutable.cs:line 580
at PSADT.ClientServer.ClientExecutable.EnterClientServerMode(ReadOnlyDictionary`2 arguments) in D:\a\PSAppDeployToolkit\PSAppDeployToolkit\src\PSADT\PSADT.ClientServer.Client\ClientExecutable.cs:line 344
--- End of inner exception stack trace ---
at PSADT.ClientServer.ServerInstance.Invoke[T](String command) in D:\a\PSAppDeployToolkit\PSAppDeployToolkit\src\PSADT\PSADT.ClientServer.Server\ServerInstance.cs:line 622
at CallSite.Target(Closure , CallSite , Object , String , Object , Object )
FullyQualifiedErrorId : ServerException,Show-ADTInstallationWelcome
ScriptStackTrace : at Private:Invoke-ADTClientServerOperation, C:\Temp\T22025.2\Ready_v4\PSAppDeployToolkit\PSAppDeployToolkit.psm1: line 1337
at Show-ADTWelcomePrompt, C:\Temp\T22025.2\Ready_v4\PSAppDeployToolkit\PSAppDeployToolkit.psm1: line 19562
at Show-ADTInstallationWelcome<Process>, C:\Temp\T22025.2\Ready_v4\PSAppDeployToolkit\PSAppDeployToolkit.psm1: line 19863
at Install-ADTDeployment, C:\Temp\T22025.2\Ready_v4\Invoke-AppDeployToolkit.ps1: line 130
at <ScriptBlock>, C:\Temp\T22025.2\Ready_v4\Invoke-AppDeployToolkit.ps1: line 284
at <ScriptBlock>, <No file>: line 1
PositionMessage : At C:\Temp\T22025.2\Ready_v4\Invoke-AppDeployToolkit.ps1:130 char:5
+ Show-ADTInstallationWelcome -CloseProcesses 'T2Txp'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Invoke-AppDeployToolkit.ps1 2025-12-16 3:10:14 PM 33948 (0x849C)