Uninstall from Company Portal does not work on Powershell scripts

Pavel yannara Mirochnitchenko 13,341 Reputation points MVP
2023-12-22T08:55:42.5333333+00:00

I have many Win32 custom apps I script with powershell. Everything works as a charm, but now I noticed, that when end user tries to uninstall the app from CP, NOTHING will happen. No activity, no logs. If I change Uninstall string from powershell to C:\program files\SomeApp\uninstall.exe /S, this will work.

In Uninstall string, I call uninstall parameter like this:
**%SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy ByPass -File Uninstall_driver_updates.ps1
**
The script contains logging and removing of detection file:
#Start logging

Start-Transcript -Path "C:\LABS\Logs\Drivers\Uninstall_Drivers_Update.log"

#Uninstall this app by deleting folder with logs

Remove-Item -Recurse -Force -Path "C:\LABS\Logs\Drivers\Drivers_Updated_v11.txt"

#Stop logging

**Stop-Transcript
**
If I click Uninstall button in Company Portal, it rolls for a while and gets back to Installed state. No activity in Intuneextention.log file.

Microsoft Security | Intune | Application management
Microsoft Security | Intune | Other
0 comments No comments
{count} votes

Accepted answer
  1. Crystal-MSFT 53,991 Reputation points Microsoft External Staff
    2023-12-25T03:32:59.91+00:00

    @Pavel yannara Mirochnitchenko, Thanks for posting in Q&A. Based on my researching, end-users can uninstall Win32 apps using the Windows Company Portal if the apps were assigned as available and were installed on-demand by the end-users. Please confirm if the affected app is assigned as available and installed by the same user.

    User's image

    https://learn.microsoft.com/en-us/mem/intune/apps/apps-add#uninstall-an-app

    Hope the above information can help.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.