Execute-processAsUser Failing

Hello, im trying to deploy an App on the Clients that require User rights. I’m running this command :

Execute-ProcessAsUser -Path “$dirfiles\VSCodeUserSetup.exe” -Parameters “/VERYSILENT /NORESTART” -RunLevel ‘LeastPrivilege’ -Wait $true

And then I get this :

[05-06-2021 10:01:47.926] [Installation] [Execute-ProcessAsUser] :: Creating [C:\Users\netw10314\AppData\Local\Temp\PSAppDeployToolkit\ExecuteAsUser].
[05-06-2021 10:01:48.023] [Installation] [Set-ItemPermission] :: Setting permissions [Permissions:Read, InheritanceFlags:None, PropagationFlags:None, AccessControlType:Allow, Method:Add] on path [C:\Users\netw10314\AppData\Local\Temp\PSAppDeployToolkit\PSAppDeployToolkit-ExecuteAsUser.xml] for user [True].
[05-06-2021 10:01:48.128] [Installation] [Execute-ProcessAsUser] :: Failed to export the scheduled task XML file [C:\Users\netw10314\AppData\Local\Temp\PSAppDeployToolkit\PSAppDeployToolkit-ExecuteAsUser.xml].
Error Record:
-------------At C:\Users\w10314\Downloads\PSAppDeployToolkit_v3.8.4\Toolkit\AppDeployToolkit\AppDeployToolkitMain.ps1:11709 char:6
+                     $Acl.AddAccessRule($Rule)
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~
Error Inner Exception(s):
-------------------------

Hi Bratan,

do you changed the AppDeployToolkitMain.ps1? Sounds like their is an error in the line 11709 character 6 of the Main.ps1 File.

Can you check your Main.ps1 File?

Dayst

were you able to solve your issue? I’m currently having the same problem with the same application.

If i understand what you are trying to do correctly, you are trying to Execute-ProcessAsUser when PSADT already is running as the desired user.

Try to use Execute-Process instead or run PSADT as an administrator.