Correct Syntax to force close apps

I’m trying to script the following behavior - allow 3 deferrals and prompt users to close a few Adobe apps. But if the user has locked the their session, force the apps to close and proceed with the install. I have this:

Show-ADTInstallationWelcome -CloseProcesses @{ Name = 'incopy'; Description = 'Adobe InCopy' }, @{ Name = 'indesign'; Description = 'Adobe Indesign' }, @{ Name = 'photoshop'; Description = 'Adobe Photoshop' } -blockexecution -persistprompt -AllowDefer -DeferTimes 3 -ForceCloseProcessesCountdown 30

At the moment, the log file indicates that it hangs while acknowledging that the apps are open.
[Pre-Install] :: The following processes are running: [InCopy,InDesign,Photoshop]

I’m not sure if this scenario was ever handled in V3, FoldZan1’s extension or in v4.

We don’t have a way to do that, and I’m reluctant to add any logic here as that’d be a first class ticket to a pissed off user IMHO.

Thanks for the reply. I must have misread the docs, so what does the ForceCloseProcessesCountdown or ForceCountdown on Show-ADTInstallationWelcome do?

The reference is your friend:

-ForceCloseProcessesCountdown : Show-ADTInstallationWelcome · PSAppDeployToolkit

-ForceCountdown : Show-ADTInstallationWelcome · PSAppDeployToolkit

1 Like

To me that reads as if it should do what I’m after, i.e. provide a countdown which closes the specified apps regardless of whether or not a user clicks defer. It doesn’t do that for me.

Yes it will do this if the user is logged on (and has not locked their screen) as the script is running Interactive, if they have locked their screen this won’t work (as the script would need to be run Silent)
This is handled at start up, see this:

There is one solution that may go some way to help you in this scenario, the Invoke-ServiceUI.ps1 script as it can detect the status of the machine before triggering the install, this is detailed here:

1 Like