Author Topic: Uninstalling via powershell silently Microsoft Endpoint  (Read 789 times)

0 Members and 1 Guest are viewing this topic.

Offline jason.fritz

  • Newbie
  • *
  • Posts: 1
Uninstalling via powershell silently Microsoft Endpoint
« on: June 16, 2021, 05:52:33 PM »

I am computer Technician that focuses on Microsoft Endpoint Manager Windows 10 rollout for over 2k computers currently. I am working on uninstalling Avast that comes preloaded on some of the machines. I am looking at using Microsoft Endpoint Manager for this. I believe it to be possible but only need a little direction on this to get it to be successful.

I have downloaded the Avastclear.exe
Create a powershell script in the same folder as avastclear.exe

# Run the cleanup tool
$program= ".\avastclear.exe"
$programArg= "-p"
$process = Start-Process $program -ArgumentList $ProgramArg -passthru -Wait -NoNewWindow
 Remove the Store apps from Avast
$RemoveApp = 'Avast'
Get-AppxPackage -AllUsers | Where-Object {$_.Name -Match $RemoveApp} | Remove-AppxPackage
Get-AppxPackage | Where-Object {$_.Name -Match $RemoveApp} | Remove-AppxPackage
Get-AppxProvisionedPackage -Online | Where-Object {$_.PackageName -Match $RemoveApp} | Remove-AppxProvisionedPackage -Online

Created a IntuneWin package with he Microsoft Win32 Content Prep Tool

.\IntuneWinAppUtil.exe -c "c:\temp\avastclear.exe" -s "avastclear.ps1" -o "c:\temp" -q

Add it as a new package in Microsoft Endpoint Manager as a Windows app (Win32)

I would like some advice on these steps and any clarification on it. Essentially I want it to work and would like some advice on it to make sure.