PSADT v4 Execution intune with invoke_serviceui.ps1

hey,
I am trying to use the new PSAppDeployToolkit with Intune. I read the manual and examples regarding ServiceUI. I created my app and configured it as usual, using install_forceinteractive.cmd for installation and uninstall_forceinteractive.cmd for uninstallation.

However, when I run the application from the company portal, the following message appears: “An error occurred while running Invoke-AppDeployToolkit.ps1. Exit code: 1”. In the invoke-appdeploytoolkit.exe log, it states: “Commencing invocation … Administrator rights are required. The verb ‘RunAs’ will be used with the invocation. No ‘-File’ parameter specified on command-line”.

On the Intune side, I set the app’s Install behavior to “System”.

Hi @Elric, the ServiceUI examples weren’t working at all from my own testing. I’ve updated them in our develop branch which you can obtain here: PSAppDeployToolkit/examples/ServiceUI at develop · PSAppDeployToolkit/PSAppDeployToolkit · GitHub

Replace any previous copies of the batch files and Invoke-ServiceUI.ps1 with these and you should be golden.

Hi @mjr4077au,

Great news! I’ve tested the script from the dev branch, and it’s working perfectly.

Thank you so much for your quick response and excellent work!

Hey Eric,

Could you please explain this Invoke-ServiceUI.ps1 is being used?

I can see is it a part of PSADT v3.10.2 under “Examples\ServiceUI” but no such examples in PSADT v4.0.

For me in PSADT v3.10.2, If I put “ServiceUI.exe” under root folder & set the command on Intune like below it works.
Install Command: ServiceUI.exe -Process:explorer.exe Deploy-Application.exe -DeploymentType “Install”

But when I am trying the same in PSADTv4.0 it’s not working with below command.
ServiceUI.exe -Process:explorer.exe Invoke-AppDeployToolkit.exe -DeploymentType “Install”

Could you please help me with “Invoke-ServiceUI.ps1” as in where we have to put this script & what Install Command should be set on Intune.

It worked fine if I rename the file in “ServiceUI.exe” to ServiceUI_x64.exe & pass the below command:
ServiceUI_x64.exe -Process:explorer.exe Invoke-AppDeployToolkit.exe -DeploymentType “Install”