I have a PSADT deployment for adding the Japanese IME in Windows 10. Part of it involves Removing and/or adding the Japanese language to the language list for the logged on user. The other part of the deployment is run as the system account. I have this in the Deploy-Application file:
Execute-ProcessAsUser -Path “$PSHOME\powershell.exe” -Parameters “-ExecutionPolicy Bypass -Command &{& “$dirFiles\AddLanguage.ps1”}” -Wait
There is no error and my Deploy-Application script completes to the end but the AddLanguage.ps1 is not run. Here are the errors from the PSADT log:
-------------------------]LOG]!><time=“11:23:05.488-240” date=“07-15-2022” component=“Execute-ProcessAsUser” context=“NT AUTHORITY\SYSTEM” type=“3” thread=“7368” file=“Deploy-Application.ps1”>
<![LOG[[Post-Installation] :: Previous [C:\Windows\TEMP\PSAppDeployToolkit\ExecuteAsUser] found. Attempting removal.]LOG]!><time=“11:25:24.569-240” date=“07-15-2022” component=“Execute-ProcessAsUser” context=“NT AUTHORITY\SYSTEM” type=“1” thread=“7368” file=“Deploy-Application.ps1”>
<![LOG[[Post-Installation] :: Delete folder [C:\Windows\TEMP\PSAppDeployToolkit\ExecuteAsUser] recursively…]LOG]!><time=“11:25:24.574-240” date=“07-15-2022” component=“Remove-Folder” context=“NT AUTHORITY\SYSTEM” type=“1” thread=“7368” file=“Deploy-Application.ps1”>
<![LOG[[Post-Installation] :: Creating [C:\Windows\TEMP\PSAppDeployToolkit\ExecuteAsUser].]LOG]!><time=“11:25:24.578-240” date=“07-15-2022” component=“Execute-ProcessAsUser” context=“NT AUTHORITY\SYSTEM” type=“1” thread=“7368” file=“Deploy-Application.ps1”>
<![LOG[[Post-Installation] :: Preparing a vbs script that will start [C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -Command &{& ] as the logged-on user [C:\TEMP\JapaneseIMEDism\Files\AddLanguage.ps1}] silently…]LOG]!><time=“11:25:24.586-240” date=“07-15-2022” component=“Execute-ProcessAsUser” context=“NT AUTHORITY\SYSTEM” type=“1” thread=“7368” file=“Deploy-Application.ps1”>
<![LOG[[Post-Installation] :: Setting permissions [Permissions:Read, InheritanceFlags:None, PropagationFlags:None, AccessControlType:Allow, Method:Add] on path [C:\Windows\TEMP\PSAppDeployToolkit\ExecuteAsUser\PSAppDeployToolkit-ExecuteAsUser.vbs] for user [C:\TEMP\JapaneseIMEDism\Files\AddLanguage.ps1}].]LOG]!><time=“11:25:24.595-240” date=“07-15-2022” component=“Set-ItemPermission” context=“NT AUTHORITY\SYSTEM” type=“1” thread=“7368” file=“Deploy-Application.ps1”>
<![LOG[[Post-Installation] :: Failed to set read permissions on path [C:\Windows\TEMP\PSAppDeployToolkit\ExecuteAsUser\PSAppDeployToolkit-ExecuteAsUser.vbs]. The function might not be able to work correctly.]LOG]!><time=“11:25:24.599-240” date=“07-15-2022” component=“Execute-ProcessAsUser” context=“NT AUTHORITY\SYSTEM” type=“2” thread=“7368” file=“Deploy-Application.ps1”>
<![LOG[[Post-Installation] :: Setting permissions [Permissions:Read, InheritanceFlags:None, PropagationFlags:None, AccessControlType:Allow, Method:Add] on path [C:\Windows\TEMP\PSAppDeployToolkit\PSAppDeployToolkit-ExecuteAsUser.xml] for user [C:\TEMP\JapaneseIMEDism\Files\AddLanguage.ps1}].]LOG]!><time=“11:25:24.607-240” date=“07-15-2022” component=“Set-ItemPermission” context=“NT AUTHORITY\SYSTEM” type=“1” thread=“7368” file=“Deploy-Application.ps1”>
<![LOG[[Post-Installation] :: Failed to export the scheduled task XML file [C:\Windows\TEMP\PSAppDeployToolkit\PSAppDeployToolkit-ExecuteAsUser.xml].
Error Record:
-------------At C:\TEMP\JapaneseIMEDism\AppDeployToolkit\AppDeployToolkitMain.ps1:11709 char:6
-
$Acl.AddAccessRule($Rule)
-
~~~~~~~~~~~~~~~~~~~~~~~~~
Error Inner Exception(s):
Any idea on how to get this to work?