To be able to uninstall programs with Powershell, at least Powershell 5.0 should be installed. However, if WMI is used, it must be possible to fall back on the Win32_Product class. Accessing WMI is very easy thanks to Powershell.

Get-WMIObject -Class Win32_Product -Filter "name like '%Office%'"

To uninstall, the Uninstall() method can be used.

$VS = Get-WMIObject -Class Win32_Product -Filter "name = 'Microsoft Visual Studio%'" $VS.Uninstall()

Unfortunately, the Win32_Product class does not return all installed programs and is not very fast. It's easier with the Powershell Package Manager (part of Powershell 5.0 and later).

Uninstall-Package -name '7-Zip'

Get-Package shows all installed programs.

Get-Package

Interesting is also the parameter -Providername, with which you can search for specific installer types:

Get-Package -Providername msi