Are you unable to remove a program from Windows? Do you need to remove a lot of programs together? Then follow this guide to Uninstall Programs with PowerShell in six different ways.
PowerShell is an object-oriented command line-based tool. Today, in this post, we will discuss various methods for PowerShell uninstall program, so follow all the methods for the best result.
Workable Solutions | Step-by-step Troubleshooting |
---|---|
1. Using Get-Package Commands | If you want to uninstall a single program via PowerShell, use the Get-Package...Full steps |
2. Uninstall-Package Commands | Get-Package points out a particular package and sends the program identity object...Full steps |
3. Uninstall Multiple Programs | If you want to delete multiple programs with similar names, you can use...Full steps |
More Fixes | The other 3 fixes are available here for you to follow and uninstall programs with PowerShell...Full steps |
PowerShell permits developers and IT professionals to configure systems and automate administrative tasks. It has various features:
How to Open PowerShell on Windows 10
Consider this guide that elaborates on the definition of PowerShell and the five absolute ways to open it on your Windows 10. Read more >>
When you are uninstalling a program via PowerShell, there is a possibility that you will lose the software's data. So you should recover deleted files in advance. We recommend the powerful data recovery software for Windows users, which is none other than EaseUS Data Recovery Wizard.
This advanced data recovery tool helps users recover data from corrupted hard drive and crashes. Let's discuss more on its features and uses in detail.
EaseUS Data Recovery Wizard tool is the one-stop solution for data recovery with a 99.7% success rate. This tool can Recover data lost due to deleting, formatting, partition loss, unbootable or crashed system, virus attack, etc., from PC, USB drives, SD cards, cameras, and other devices.
✒️Notice: Because this software is only available in trial mode, you must activate it before performing the bootable data recovery operation. As a result, we recommend that you acquire an activation key to gain full capabilities. |
Step 1. Run EaseUS Data Recovery Wizard on your computer. Choose the drive where you lost files and click "Search for Lost Data". If your lost files were on an external storage device, connect it to your computer firstly.
Step 2. The software will quickly scan the deleted files immediately, and then automatically perform a deep scan to find more lost files. After the scan is completed, you can use "Filter" or "Search box" to quickly locate specific file types.
Step 3. Click the "Preview" button or double-click on a file for a full preview. Finally, select the desired files, click "Recover" and choose another safe location or Cloud drive to save all the files at once.
If you want to install programs with the help of PowerShell, then there are several ways to do it, but ensure to safeguard the critical data of those programs. In this part, we will provide you with six methods to uninstall programs with PowerShell, so follow the exact methods to get the best result.
If you want to uninstall a single program via PowerShell, use the Get-Package Commands. Run the below command on PowerShell to perform the process.
"Uninstall-Package-Name"
Example:
PS> winget list
PS> Uninstall-Package -Name WebEx
Here the Winget list commands reveal the list of all programs and the exact name required by the following command to uninstall. The Name parameters specify the package to uninstall and register with the OS.
How to Delete File PowerShell [Command Lines]
This article will provide adequate details about how to delete files using the Remove-item cmdlet and delete files using WMI. Read more >>
Get-Package points out a particular package and sends the program identity object down the pipeline to the Uninstall-Package cmdlet.
Use the below script to uninstall the program with Uninstall package commands.
"Get-Package-Name | Uninstall-Package"
Example:
PS> Get-Package -Name "Virtual Pet" | Uninstall-Package
The Get-Package cmdlet uses the name and version parameters to specify a package. A program identity object is sent down the pipeline. The Uninstall-Package cmdlet receives the object as an InputObject and removes the package.
If you want to delete multiple programs with similar names, you can use the wildcard operator to remove all of them in one shot. If it's an Adobe product, it usually starts with the name Adobe. The same goes for Microsoft and so on.
PowershellGet-Package *adobe* | Uninstall-Package
PowershellGet-Package *adobe*, *Office* | Uninstall-Package
A command's ability to use dynamic parameters can be enabled by including a package provider in it. A package provider's dynamic parameters are unique. The Get-Help cmdlet displays a list of parameter sets for a cmdlet, which includes the provider's parameter set.
More Fixes |
4. Run the Remove-WmiObject Commands |
5. Create a Script for Uninstalling Programs in Bulk |
6. Uninstall Programs on Remote Computers via Invoke-Command |
Let us learn more ways about the PowerShell uninstall program. What's more, don't forget to mark this passage by sharing it on Facebook, Twitter, or SNS.
You can run the Remove-WmiObject commands to uninstall a program via PowerShell. Follow the below steps to perform the process.
Step 1. Run the below command to get the list of all installed applications.
Get-WmiObject -Class Win32_Product
Step 2. List installed programs by name with this command
Get-WmiObject -Class Win32_Product -Filter "Name = 'Power Automate for desktop'"
Step 3. To uninstall an application, save the WMI object and call Uninstall(). Run the below command to proceed.
$application= Get-WmiObject -ClassWin32_Product-Filter "Name = 'Program A'"
$application.Uninstall()
You can easily uninstall bulk programs via Powershell by using the below script. The script takes a list of programs, uses the Get WMI OBJECT to find the product, and then chooses to uninstall it.
It's essential to use the exact name of the program to get it into the list.
$programs = @("app1","app2","app3","app4") foreach($program in $programs){ $app = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -match "$program" } if ($app -ne $Null) { $app.Uninstall() } } |
Example:
$programs = @("iTunes","Dropbox Update Helper") foreach($program in $programs){ $app = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -match "$program" } if ($app -ne $Null) { $app.Uninstall() } } |
If you want to uninstall programs on remote computers, you can do it easily on PowerShell with the help of invoke-Command. Follow the below steps to know the complete process.
Step1. The below script will take the computer name, your username, and password, connect to the remote PC and list all installed software by name.
$computerName = "PCName" |
$yourAccount = Get-Credential |
Invoke-Command -ComputerName $computerName -Credential $yourAccount -ScriptBlock { Get-WmiObject Win32_Product | Select Name } |
Step 2. After getting the product's name, if you want to uninstall it remotely, use the script below.
$computerName = "PCName" |
$appName = "AppName" |
$yourAccount = Get-Credential |
Invoke-Command -ComputerName $computerName -Credential $yourAccount -ScriptBlock { Get-WmiObject Win32_product | Where {$_.name -eq $appName} | ForEach { $_.Uninstall() } } |
In the above script, replace the PCName with the name of the computer you wish to uninstall from.
LEARN MORE
Still curious? Click here to learn about The Ways to Fix Windows PowerShell Keeps Popping Up
Undoubtedly PowerShell is a handy inbuilt open-source Windows scripting platform that helps professionals in several ways. Here we have discussed how you can uninstall programs with the help of this tool. During the program uninstallation process, using a data recovery tool like EaseUS Data Recovery Wizard is crucial because it will help you recover and restore data from your PC.
Here are 4 additional questions about removing a program from Windows. Check here for the answers.
1. How do I uninstall a program using PowerShell?
You can uninstall a program using PowerShell by using the command: Uninstall-Package -Name
2. How do I uninstall a program from PowerShell in Windows 10?
In the PowerShell window, use the command Get-AppxPackage program name and Remove-AppxPackage and press Enter to remove the target program directly.
3. How do I uninstall an exe file in Windows 11?
EXE is an extension for executables. There are two ways to uninstall it. First, go to Settings, then click the Remove button from the application list. Second is when it is a probable program, then a simple delete of the EXE or the folder in which the program does the job.
4. How do I delete a file in Windows 11 by command prompt?
You can delete a file in Windows 11 by command prompt by running the DEL//F file name command and pressing Enter.
Related Articles
How to Choose the Right Custom USB Drive for Your Needs
macOS Cannot Verify That This App Is Free from Malware [Error Solved]
How to Fix Minecraft OpenGL Errors [Full Guide]
Fix Application Error 0xc0000142 in Microsoft Office [8 Solutions]