Answer the question
In order to leave comments, you need to log in
Working way to uninstall a program via PowerShell?
Is there a way to uninstall a program using just PowerShell? I searched the Internet, but did not find a single working solution. For example, I need to uninstall McAfee antivirus, only using PowerShell, how can I do it? I will be very grateful for your help.
Answer the question
In order to leave comments, you need to log in
Get-WmiObject -Class Win32_Product | Select-Object -Property Name - search here for the program you need to remove
$MyApp = Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -eq "McAfee"} - quoted value may differ
$MyApp.Uninstall()
It is possible to try still through GUID.
To get a list of applications and their GUIDs
get-wmiobject Win32_Product | Sort-Object -Property Name |Format-Table IdentifyingNumber, Name, LocalPackage -AutoSize
msiexec /x {GUID интересующего приложения внутри фигурных скобок}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question