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:
- 🎚️PowerShell automates system tasks like batch processing.
- 🛠️It generates system management tools for generally implemented processes.
- 💻It can extract information on OSes and much more.
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 >>
Recover When You Accidentally Delete the App Data
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.
- Repair corrupted Videos/Photos on the sd card, memory card, and hard drive, and repair any damaged, corrupt, and broken MP4 and MOV videos.
- NAS Recovery. EaseUS Data Recovery Wizard tool can quickly recover data from the NAS server. You can effortlessly recover any data from a NAS server.
- PE Recovery. This tool can create WinPE bootable disk for data recovery, which help users to recover essential data from their non-bootable PC hard drive.
✒️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.
How to Uninstall Programs with PowerShell
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.
Fix 1. Uninstall Single Program Using Get-Package Commands
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 >>
Fix 2. Uninstall Program with Uninstall-Package Commands
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.
Fix 3. Uninstall Multiple Programs Using Get-Package with Wildcards
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.
- To remove all products from the same company:
PowershellGet-Package *adobe* | Uninstall-Package
- To remove multiple products from multiple OEMS:
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.
Fix 4. Run the Remove-WmiObject Commands
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()
Fix 5. Create a Script for Uninstalling Programs in Bulk
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() } } |
Fix 6. Uninstall Programs on Remote Computers using Invoke-Command
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
Final Thoughts
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.
PowerShell Uninstall Programs FAQs
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.
Was This Page Helpful?
Jaden is one of the editors of EaseUS, who focuses on topics concerning PCs and Mac data recovery. Jaden is committed to enhancing professional IT knowledge and writing abilities. She is always keen on new and intelligent products.
Related Articles
-
Games Keep Crashing on Windows 10/11 - 13 Quick Fixes
Sherly/2024-05-06
-
How to Format SD Card on Chromebook [With Specific Steps]
Tracy King/2024-01-11
-
Like a Dragon Save & Config File Location on PC/Steam
Larissa/2024-03-25
-
WD My Passport for Mac Not Mounting | Possible Reasons and Solutions
Brithny/2024-01-30
EaseUS Data Recovery Services
EaseUS data recovery experts have uneaqualed expertise to repair disks/systems and salvage data from all devices like RAID, HDD, SSD, USB, etc.