Invoke-AppDeployToolkit.ps1. Exit Code: 1

Hello!

I’m new to PSADT and just deployed our first application using v4 with MECM. 210 successful installations. However, I’ve had 4 users so far get this error:

The AppEnforce.log shows the exact logging info for a failed vs a successful install with only the exit codes being different. The PSADT log file [for Invoke-AppDeployToolkit.exe] doesn’t give much direction on what the issue could be either:

Commencing invocation of C:\name\ccmcache\f1\Invoke-AppDeployToolkit.ps1.
Administrator rights are required. The verb 'RunAs' will be used with the invocation.
No '-File' parameter specified on command-line. Adding parameter '-File "C:\name\ccmcache\f1\Invoke-AppDeployToolkit.ps1"'...
Executable Path: C:\WINDOWS\system32\WindowsPowerShell\v1.0\PowerShell.exe
Arguments: -ExecutionPolicy Bypass -NonInteractive -NoProfile -NoLogo -WindowStyle Hidden -File "C:\name\ccmcache\f1\Invoke-AppDeployToolkit.ps1"
Working Directory: C:\name\ccmcache\f1\
An error occurred while running Invoke-AppDeployToolkit.ps1. Exit code: 1

I saw another post with a similar error, and the suggestion was that there might be a typo in the script somewhere. I don’t feel like this is the case given that it works for the majority of our users. The interesting thing for me is, when I manually install the app using cmd/msiexec, I run into an issue where Windows complains that it can’t close all apps (explorer). This wasn’t necessary in all my testing or the other successful installs. I feel like this makes it more of some Windows issue, but I’m never given enough time on the problem machines to track it down further.

I would greatly appreciate some advice on how to track down what the issue could be, please. I’m concerned with further use of PSADT if I can’t resolve this. Will these 4 users/computers be putting in tickets for every install using PSADT? Luckily, it’s only 4 so far, but we do have 40 more machines that haven’t reported success yet, so if there are more and they just haven’t complained yet, that could potentially overwhelm our small team (me). :smirking_face:

A side question to this: is it possible to hide this error without making the deployment completely silent? I would like if this error window doesn’t pop up and it just quietly fails in Software Center for our users. That might not be possible, since by default, I want this to be an interactive installation, but would like confirmation that it’s not, please.

You will need to specify what command line you are giving SCCM to launch PSADT v4.

I find it very weird that some users have it running elevated and others don’t.

I’m using the script option and selecting “Invoke-AppDeployToolkit.exe” as the executable.

I’m using the v4 Template structure and I’ve only modified the Invoke-AppDeployToolkit.ps1 file of the root directory.

What does the PSADT log files for Invoke-AppDeployToolkit.ps1 located in the C:\Windows\Log\Software\ folder say?

All machines with this issue have the same error log info:

Commencing invocation of C:\name\ccmcache\f1\Invoke-AppDeployToolkit.ps1.
Administrator rights are required. The verb 'RunAs' will be used with the invocation.
No '-File' parameter specified on command-line. Adding parameter '-File "C:\name\ccmcache\f1\Invoke-AppDeployToolkit.ps1"'...
Executable Path: C:\WINDOWS\system32\WindowsPowerShell\v1.0\PowerShell.exe
Arguments: -ExecutionPolicy Bypass -NonInteractive -NoProfile -NoLogo -WindowStyle Hidden -File "C:\name\ccmcache\f1\Invoke-AppDeployToolkit.ps1"
Working Directory: C:\name\ccmcache\f1\
An error occurred while running Invoke-AppDeployToolkit.ps1. Exit code: 1

I think you edited Invoke-AppDeployToolkit.ps1 in a way that causes exitcode: 1

Run your edited Invoke-AppDeployToolkit.ps1 without the EXE and see if it installs.

Thanks for the suggestion, but if that was the case, wouldn’t it fail for everyone?
If I get my hands on one of the problem systems today, I’ll try running just the ps1.

I was able to run the ps1 on the last system and it returned that ps scripts were blocked on that system. I would have never thought to check this since this change was made to all company computers several months ago to allow psadt. I’ll make sure to include running the ps1 directly in the event of errors moving forward.

2 Likes