AppProcessesToClose v4.1.7

Hello All
Fast question before 2026 :wink:

Regarding the "AppProcessesToClose"
in this new version it works like this:
$adtSession = @{
# App variables.
AppProcessesToClose = @('excel', @{ Name = 'winword'; Description = 'Microsoft Word' })
}

Let's say that i want to close all of them it would be like this:

## If there are processes to close, show Welcome Message with a 60 second countdown before automatically closing.
    if ($adtSession.AppProcessesToClose.Count -gt 0)
    {
        Show-ADTInstallationWelcome -CloseProcesses $adtSession.AppProcessesToClose -Silent
    }

but let's say that i would like to close one software silent (Word) and other software close manual if opened (excel).
How could I do that?
like this?

$adtSession = @{
    # App variables.
    AppProcessesToClose = @{ Name = 'winword'; Description = 'Microsoft Word' }
}

## If there are processes to close, show Welcome Message with a 60 second countdown before automatically closing.
    if ($adtSession.AppProcessesToClose.Count -gt 0)
    {
        Show-ADTInstallationWelcome -CloseProcesses $adtSession.AppProcessesToClose -Silent
    }

    Show-ADTInstallationWelcome -CloseProcesses 'excel'

Thank you so much

You'd just not put winword into that array, you'd just use Stop-Process to kill it instead.

1 Like