Hi All,
I am trying to remove a MSI which is installed with the logged-in user (see code below), but when removing using " Uninstall-ADTApplication -Name 'Program' -ApplicationType 'MSI' " i get the error that the program cannot be found. I can manually remove the program under control panel, but it asking for admin credentials which is not ideal.
Does anyone as a solution to this challenge ?
## Install program (MSI)
## Get currently logged on user
$currentlyLoggedOnUser = (Get-ADTLoggedOnUser).username
$CurrentlyLoggedOnUserFolder = "C:\Users\$currentlyLoggedOnUser\Pogram"
## Create user folder if needed
if (!(Test-Path -Path $CurrentlyLoggedOnUserFolder)) {
New-Item -Path $CurrentlyLoggedOnUserFolder -ItemType Directory -Force
}
## Copy script file to user folder
Copy-Item -Path "$($adtSession.DirFiles)\Program.msi" -Destination "$CurrentlyLoggedOnUserFolder" -Force
## Run the script file to finalize the installation as the currently logged on user
Start-ADTMsiProcessAsUser -Action ‘Install’ -FilePath $CurrentlyLoggedOnUserFolder\program.msi
Error :
[2025-08-20T15:27:24.6264851+02:00] [Uninstall] [Start-ADTProcess] [Error] :: Execution failed with exit code [1605] because the product is not currently installed.
[2025-08-20T15:27:24.6752844+02:00] [Uninstall] [Uninstall-ADTApplication] [Error] :: Execution failed with exit code [1605] because the product is not currently installed.
Error Record:
-------------
Message : Execution failed with exit code [1605] because the product is not currently installed.