VMware Horizon Community
Jubish-Jose
Hot Shot
Hot Shot

Microsoft To-Do App via Powershell

Long story short - I want Microsoft To-Do app installed on instant clones and it looks like installing it on the Golden image doesn't seem work because after cloning and customisation, the app is no longer there. So I am trying to install it directly on the VM when the user logs in by using elevated task. The Powershell script is from here: https://silentinstallhq.com/microsoft-to-do-microsoft-store-app-install-uninstall-powershell/

I have configured all the files on the VM and running it manually works fine, but when I set the below command as an elevated task, it fails.

Elevated Task Executable: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Arguments: -ExecutionPolicy Bypass "C:\Downloads\MicrosoftToDoApp\Deploy-MicrosoftToDoApp.ps1" -DeploymentType "Install" -DeployMode "NonInteractive"

The error I see is 

=======================

[11-08-2022 11:55:28.339] [Installation] [Execute-ProcessAsUser] :: Creating [C:\Users\local_jubish.jose\Temp\PSAppDeployToolkit\ExecuteAsUser].
[11-08-2022 11:55:28.387] [Installation] [Execute-ProcessAsUser] :: Preparing a vbs script that will start [C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle Hidden Add-AppxPackage "C:\Downloads\MicrosoftToDoApp\Files\Microsoft.NET.Native.Framework.1.6_1.6.27413.0_x64__8wekyb3d8bbwe.appx"] as the logged-on user [POP\jubish.jose] silently...
[11-08-2022 11:55:28.450] [Installation] [Set-ItemPermission] :: Setting permissions [Permissions:Read, InheritanceFlags:None, PropagationFlags:None, AccessControlType:Allow, Method:Add] on path [C:\Users\local_jubish.jose\Temp\PSAppDeployToolkit\ExecuteAsUser\PSAppDeployToolkit-ExecuteAsUser.vbs] for user [POP\jubish.jose].
[11-08-2022 11:55:28.501] [Installation] [Execute-ProcessAsUser] :: Failed to set read permissions on path [C:\Users\local_jubish.jose\Temp\PSAppDeployToolkit\ExecuteAsUser\PSAppDeployToolkit-ExecuteAsUser.vbs]. The function might not be able to work correctly.
[11-08-2022 11:55:28.556] [Installation] [Execute-ProcessAsUser] :: Failed to export the scheduled task XML file [C:\Users\local_jubish.jose\Temp\PSAppDeployToolkit\PSAppDeployToolkit-ExecuteAsUser.xml].
Error Record:
-------------At C:\Downloads\MicrosoftToDoApp\AppDeployToolkit\AppDeployToolkitMain.ps1:11675 char:11
+         $null = Set-Acl -Path $Path -AclObject $Acl -ErrorAction Stop
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

=======================

As I said, running it manually within the VM as admin works fine.

Any ideas?

@DEMdev 


-- If you find this reply helpful, please consider accepting it as a solution.
0 Kudos
0 Replies