K
K
Kirill Kirik2021-04-16 11:30:39
Command line
Kirill Kirik, 2021-04-16 11:30:39

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

2 answer(s)
V
Vadim, 2021-04-16
@thought_crime_1994

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()

A
Andrew S., 2021-04-16
@Bratken

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

Then delete
msiexec /x {GUID интересующего приложения внутри фигурных скобок}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question