How To Uninstall Programs Using PowerShell | SlashAdmin \ Life in IT

Listing all installed programs, checking to see if a program is installed by its name and uninstalling programs is super easy and efficient using PowerShell and the Get-WmiObject cmdlet.

List All Installed Programs

Get-WmiObject -Class Win32_Product 

Running this cmdlet will produce a list of all installed applications. Note this wont list any Windows Apps which are installed.

List Installed Programs By Name

Get-WmiObject -Class Win32_Product -Filter "Name = 'CoffeeCup Free FTP'"

Uninstall A Program By Name

To uninstall an application we simply need to save the WMI object and call .Unisntall(). So long as it returns a ReturnValue of 0 its successful.

$application = Get-WmiObject -Class Win32_Product -Filter "Name = 'CoffeeCup Free FTP'"
$application.Uninstall()

Uninstall A Program By IdentifyingNumber

$application = Get-WmiObject -Class Win32_Product -Filter "IdentifyingNumber = '{66F43DBE-6D46-4BCE-831D-0D4C13639BE8}'"
$application.Uninstall()

If you want to be certain you are uninstalling the correct program then using just the name may not be the best method. A much safer way is using the programs unique identifying number.

Below I run the cmdlet again to see if CoffeeCup Free FTP is listed and this time nothing is returned. A successful removal!