- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to uninstall software using WMI in PowerShell?
There are mainly 3 methods by which you can uninstall software using PowerShell.
WMI Method.
Using Package provider
Uninstallation String.
We will discuss here the WMI method to uninstall software.
WMI method
With WMI class Win32_Product you can retrieve the list of software uninstalled in your local or the remote systems. If you need specific software, you can filter by its name. For example,
Get-WmiObject Win32_Product -Filter "Name='Vmware tools'"
Or You can retrieve the name of the installed software using the Where-Object pipeline command.
Get-WmiObject Win32_Product | Where{$_.Name -eq "Vmware tools"}
Output
PS C:\Users\Administrator> Get-WmiObject Win32_Product | Where{$_.Name -eq "Vmware tools"} IdentifyingNumber : {D533345C-7F8D-4807-AE80-E06CE2045B0E} Name : VMware Tools Vendor : VMware, Inc. Version : 11.0.6.15940789 Caption : VMware Tools
Below are the supported methods for this WMI object command.
Get-WmiObject Win32_Product -Filter "Name='Vmware tools'" | gm -MemberType Method | Select Name, MemberType
Output
Name MemberType ---- ---------- Configure Method Reinstall Method Uninstall Method Upgrade Method
There is an Uninstall() method supported by this command. We can use this method to uninstall the software. For example,
$vtools = Get-WmiObject win32_product -Filter "Name='Vmware tools'" $vtools.Uninstall()
- Related Articles
- How to uninstall software using Package management in PowerShell?
- How to uninstall the MSI package using PowerShell?
- How to uninstall the PowerShell Module?
- How to get service information with the WMI method using PowerShell?
- How to get the running processes with the WMI object using PowerShell?
- How to uninstall a VPN
- How to traceroute using PowerShell?
- How to easily manage your software using conda?
- Uninstall APKs programmatically
- How to send email using PowerShell?
- How to format string using PowerShell?
- How to search in the file using PowerShell?
- How to connect to SSH using PowerShell?
- How to Install a Software on Linux Using Yum Command?
- How to stop multiple services using PowerShell?

Advertisements