PowerShell is an object-oriented command-line tool. In this article, we will discuss various methods for uninstalling programs with PowerShell, so make sure to go through all the methods for the best results.

Please provide the English content you want translated, and I'll translate it into Chinese for you as soon as possible.

Here's the translation in American English:
Solution Feasibility Step-by-Step Troubleshooting
1. Use the Get-Package Command If you want to uninstall a single program through PowerShell, use Get-Package...Full Steps
2. Uninstall-Package Command After identifying a specific package with Get-Package and passing the program identity object...Full Steps
3. Uninstall Multiple Programs If you want to remove several programs with similar names, you can use...Full Steps
More Fixing Techniques 3 more fixing techniques are available here for reference on uninstalling programs using PowerShell...Full Steps

PowerShell is a tool that enables developers and IT professionals to configure systems and automate management tasks. It offers a range of capabilities, including:

  • PowerShell can automate system tasks, such as batch processing.
  • It can generate system administration tools for common workflows.
  • It can retrieve information about the operating system and much more.

Of course, these are not uniquely American problems.

 
Open PowerShell

How to Open PowerShell on Windows 10

Learn what PowerShell is and discover five surefire ways to open it on Windows 10 in this guide. Read More >>

If you accidentally delete app data, you can try to recover it using these methods:

When you uninstall programs via PowerShell, there's a chance you might lose software-related data. Thus, it's best to have a file recovery solution at hand. We recommend the powerful data recovery software for Windows users, which is tools Data Recovery Wizard.

This advanced data recovery tool assists users in retrieving data from damaged hard drives and crashed systems. Let's delve into its features and applications in detail.

Data Recovery Wizard is an all-in-one solution with a 99.7% success rate for data recovery. This tool can restore lost data due to deletion, formatting, partition loss, system failure or crash, virus attacks, and supports data recovery from personal computers, USB drives, SD cards, cameras, and other devices.

  • Repair Damaged Videos / Photos: Recover corrupted videos and photos from SD cards, memory cards, and hard drives, and fix any damaged, corrupted, or broken MP4 and MOV videos.
  • NAS Recovery: Data Recovery Wizard quickly retrieves data from NAS servers. You can easily recover any data from your NAS server.
  • PE Recovery: This tool lets you create a WinPE bootable disk for data recovery, helping users recover crucial data from unbootable PC hard drives.
? Important Notice: As this software is provided in demo mode only, you will need to activate it before performing any bootable data recovery operation. Hence, we recommend obtaining an activation key to unlock all its features.

Step 1: Run Disk Drill on your computer. Select the disk with the missing files and click "Scan." If the lost files were on an external storage device, connect it to your computer first.

Select the location to scan

Step 2: The software will immediately perform a quick scan for the deleted files, and then automatically conduct a deep scan to find more lost files. Once the scanning is done, you can use the "Filter" option to quickly locate specific file types.

Select the files to recover

Step 3: Hit the “Preview” button, or double-click on the file for a full-screen preview. Finally, select the files you need and hit “Recover” to save all of them at once to another secure location.

Recover Lost Data

How to Uninstall Programs Using PowerShell

If you want to use PowerShell to remove programs, there are several ways to do it while keeping your important data safe. In this section, we'll show you six methods for uninstalling programs with PowerShell, so follow the steps carefully for the best results.

Fix 1: Uninstall a Single Program Using the Get-Package Command In PowerShell, you can use the Get-Package command to uninstall a specific program. Follow these steps: 1. Open an elevated PowerShell window. Right-click the PowerShell icon and select "Run as Administrator." 2. In the PowerShell window, first find the name of the program you want to uninstall. Type the following command and press Enter: ```powershell Get-Package -Name *program_name* -AllVersions ``` Replace `program_name` with the actual name of the program you want to uninstall. This will list all installed versions of the program. 3. Examine the output to find the specific version's ProviderName you want to uninstall. For most desktop applications, it will typically be "Programs." 4. Now, uninstall the selected program version using the following command, making sure to replace `program_name` and `provider_name` with their respective values: ```powershell Uninstall-Package -Name *program_name* -ProviderName *provider_name* -Force ``` Add the `-Force` parameter to ensure the program uninstalls quietly without prompts. Please note that these steps may not work for all programs, especially those not installed via the Windows Package Manager (such as programs installed through Settings or the Control Panel). In such cases, you might need to use alternative methods, like uninstalling through the Control Panel or the program's built-in uninstall tool.

To uninstall a single program through PowerShell, use the Get-Package command. Run the following command in PowerShell to do this:

"Uninstall Package Name"

Example:

PS> winget list

PS> Uninstall-Package -Name WebEx

Uninstall PowerShell

Here, the Winget list command shows a list of all the apps, along with the exact name required for the uninstall command. The Name parameter specifies the package to uninstall and register with the operating system.

Of course, I can help you translate English into Chinese. Please provide the English content you would like translated.

 
Uninstall a File

How to Delete a File with PowerShell [Command Line]

This post offers enough information on how to delete a file using the Remove-Item cmdlet and WMI. Read More>>

Fix 2: Uninstall the program using the Uninstall-Package command

The Get-Package cmdlet specifies the package, and passes the package identity object to the Uninstall-Package cmdlet.

Use the following script to uninstall a program using the package manager command.

"Get package name | Uninstall package"

Example:

PS> Get-Package -Name "Virtual Pet" | Uninstall-Package

Get the package command

The Get-Package command specifies the package by using the Name and Version parameters. The package identifier object is passed through the pipeline to the Uninstall-Package cmdlet, which removes the package.

Fix 3: Uninstall Multiple Programs Using Wildcards with the Get-Package Command In PowerShell, you can use the Get-Package command along with wildcards to uninstall multiple programs. This can save time, especially when you need to uninstall several applications from the same publisher. Here's how: 1. Open PowerShell (run it as an administrator). 2. Enter the following command to get a list of all packages from a specific publisher, replacing `PublisherName` with the name of the publisher whose apps you want to uninstall: ```powershell Get-Package -ProviderName Programs -AllVersions | Where-Object {$_.Publisher -like "*PublisherName*"} ``` 3. Review the output list and confirm the programs you want to uninstall. Note the `Name` property values of these programs. 4. Use the following command, replacing `PackageName1`, `PackageName2`,... with the program names identified in step 3, separated by commas: ```powershell Get-Package -Name 'PackageName1', 'PackageName2', ... -ProviderName Programs | Uninstall-Package -WhatIf ``` Adding the `-WhatIf` parameter lets you preview which packages will be uninstalled without actually doing so. If everything looks correct, remove `-WhatIf` to proceed with the uninstallation: ```powershell Get-Package -Name 'PackageName1', 'PackageName2', ... -ProviderName Programs | Uninstall-Package ``` Please note that this method may not work for all programs, especially those not installed via the Windows Package Manager. In such cases, you might need to uninstall each program individually.

If you have several similarly named programs, you can use wildcards to remove them all at once. Programs from Adobe usually start with "Adobe," while Microsoft products begin with "Microsoft."

    Remove all products from the same company:

The PowerShell command `Get-Package *adobe* | Uninstall-Package` translates to: "Get all packages that contain 'adobe' and uninstall them."

    Remove multiple products from multiple original equipment manufacturers:

Get all packages containing "Adobe" and "Office" with PowerShell | Uninstall packages

You enable the use of its dynamic parameters by including the provider in the command. The dynamic parameters of a provider are unique. The Get-Help command displays a list of parameter sets for the cmdlet, which includes the provider's parameter set.
More Fixes
4. Run the Remove-WmiObject Command
5. Create a Script for Bulk Uninstall
6. Use Invoke-Command to Uninstall Programs Remotely

Let's learn more about the methods to uninstall programs using PowerShell. Also, don't forget to bookmark this article by sharing it on Facebook, Twitter, or any other SNS.

I'm sorry, it seems like you have entered a blank message. Please provide the English content you would like translated, and I'll be glad to assist you with the translation into Chinese.

Fix 4: Run the Remove-WmiObject command

You can use the Remove-WmiObject command in PowerShell to uninstall a program. Follow these steps: 1. **Open PowerShell**: - Press `Windows key + X` and choose "Windows PowerShell" (or "Windows Terminal" if you have it installed) from the menu. - Alternatively, search for "PowerShell" in the Start menu or Cortana, then right-click on "Windows PowerShell" and select "Run as administrator" to open it with elevated privileges. 2. **Identify the WMI class related to the program**: To find the appropriate WMI class for the program you want to uninstall, you might need to query the WMI repository first. For example, to list all installed applications, run: ``` Get-WmiObject -Class Win32_Product | Select-Object Name, IdentifyingNumber, Version ``` Find the entry that corresponds to your target application. 3. **Uninstall the program using its ProductCode**: The `IdentifyingNumber` field in the output is the ProductCode (GUID) of the application. Replace `` with the actual value and run the following command: ``` Remove-WmiObject -Class Win32_Product -Filter "IdentifyingNumber=''" ``` Example: ``` Remove-WmiObject -Class Win32_Product -Filter "IdentifyingNumber='{12345678-1234-1234-1234-1234567890AB}'" ``` 4. **Confirm the uninstallation**: PowerShell will prompt you to confirm the removal. Type "Y" and press Enter to proceed. Please note that removing programs through WMI can sometimes cause issues if the program is currently running or if dependencies are not handled correctly. Make sure you're aware of the risks before proceeding. If you're unsure, consider using the traditional Add/Remove Programs feature in the Control Panel or the built-in uninstaller for the software.

Step 1. Run the following command to get a list of all installed applications:

Get-WmiObject -Class Win32_Product

Get WMI Object

Step 2: List installed programs by name with the following command:

Get-WmiObject -Class Win32_Product -Filter "Name = 'Power Automate for desktop'"

Get Product Name

Step 3: To uninstall the application, first persist the WMI object, and then call Uninstall(). Run the following command to continue:

Get-WmiObject -Class Win32_Product -Filter "Name = 'Program A'"

Uninstalling an application

Figure 4-13 Uninstalling an application

Fix 5: Create a Script for批量卸载 Programs In Windows, there might be occasions when we need to uninstall a bunch of unnecessary programs to free up disk space or boost system performance. We can streamline this process by making a batch script. Here's a straightforward example showing how to craft a script for bulk uninstallation: 1. Open Notepad. 2. Type in the following command, swapping out "ProgramName" with the name of the program you want to uninstall. Each program should be on a separate line. ```batch start /wait msiexec.exe /x {ProductCode} /qn ``` Here, `{ProductCode}` is the unique identifier for the software, usually found in the program's properties or installation files. If you know the product's `{ProductCode}`, substitute it correspondingly. For instance: ```batch start /wait msiexec.exe /x {12345678-90AB-CDEF-1234-567890ABCDEF} /qn start /wait msiexec.exe /x {AnotherCode} /qn ``` 3. Save the file, hit "Save As..." (另存为...), enter a descriptive name (like `UninstallBatch.bat`) in the "File name" (文件名) field, and ensure "Save as type" (保存类型) is set to "All Files" (所有文件). 4. From the "Encoding" (编码) dropdown, pick "ANSI." 5. Select a suitable spot for the file in the "File location" (文件位置) field, then hit "Save" (保存). 6. Now, you've got a batch script. Double-click the file to execute it, and it'll begin uninstalling programs in the sequence outlined in the script. Bear in mind that these actions can't be undone, so confirm you genuinely want to uninstall the programs before running the script. This is just a basic illustration; an actual bulk uninstallation might entail more intricate logic, like reading the program list from the registry or a text file. Prior to any mass uninstallations, remember to back up crucial data and approach cautiously.

Using the following script, you can easily uninstall a large number of programs via PowerShell. The script takes a list of programs, uses the Get-WMIObject command to locate the corresponding products, and then proceeds to uninstall them. Here's the simplified translation in American English: ```powershell # Create an array containing the names of the programs to uninstall $programsToUninstall = @("Program1", "Program2", "Program3") foreach ($program in $programsToUninstall) { # Get WMI object to search for the program $wmi = Get-WmiObject -Class "Win32_Product" -Filter "Name like '%$program%'" -ErrorAction SilentlyContinue if ($wmi) { # If the program is found, uninstall it Write-Host "Uninstalling $program..." $wmi.Uninstall() Write-Host "$program has been uninstalled." } else { Write-Host "$program not found." } } ``` Replace "Program1", "Program2", "Program3" with the actual names of the programs you want to uninstall. Before running this script, ensure you have permission to uninstall these programs, and be aware that it may affect your system.

To list a program, you must use its correct name.

Example:

Bulk Uninstall Programs

Fix 6: Uninstall the program using Invoke-Command on a remote computer

If you need to uninstall a program on a remote computer, you can do so easily in PowerShell using the Invoke-Command. Follow these steps to learn how:

Step 1: The script below gets the computer name, user name, and password, connects to the remote PC, and lists all installed software by name.

Step 2: After you have the product name, use the following script to uninstall it remotely.

$computerName = "PCName"
$appName = "AppName"
$yourAccount = Get-Credential
Invoke-Command -ComputerName $computerName -Credential $yourAccount -ScriptBlock { Get-WmiObject Win32_product | Where {$_.name -eq $appName} | ForEach { $_.Uninstall() } }
$computerName = "PCName"
$appName = "AppName"
$yourAccount = 获取凭据
Invoke-Command -ComputerName $computerName -Credential $yourAccount -ScriptBlock { Get-WmiObject Win32_product | Where {$_.name -eq $appName} | ForEach { $_.Uninstall() } }

In the script, replace PCName with the name of the computer you want to uninstall from.

Of course, I'd be happy to help. Please provide the text you'd like me to translate into English.

Learn More

Want to know more? Click here to find out how to fix the issue of Windows PowerShell keeps popping up

Final Thoughts

Undoubtedly, PowerShell is an inbuilt, open-source Windows scripting platform that offers professionals convenience in numerous ways. In this article, we will discuss how to utilize this tool for uninstalling programs. During the process of program uninstallation, using data recovery tools like the Data Recovery Wizard is crucial, as it can assist in recovering and restoring data from your computer.

Frequently Asked Questions about Uninstalling PowerShell

Here are four additional questions about uninstalling programs from Windows. You can find the answers here.

**How to Uninstall Programs Using PowerShell?** In the Windows operating system, you can use PowerShell to uninstall programs. Follow these steps: 1. Open PowerShell: Click on the "Search" box, type "PowerShell," and run it as an administrator (right-click on the PowerShell icon and select "Run as administrator"). 2. In the PowerShell window, enter the following command to get the name of the program you want to uninstall: ``` Get-AppxPackage ``` This will list all installed applications. Look for the full name of the program you want to uninstall. 3. Once you have the full name of the program, use the following command to uninstall it, replacing `PackageName` with the actual package name: ``` Remove-AppxPackage -PackageName PackageName ``` For example, if you want to uninstall a program named `Microsoft.BingNews`, the command would be: ``` Remove-AppxPackage -PackageName Microsoft.BingNews ``` 4. Press Enter to execute the command. The system may prompt you to confirm the uninstallation. If prompted, follow the instructions to proceed. Please note that this method works for UWP (Universal Windows Platform) apps. For traditional desktop applications, you might need to uninstall them through the "Programs and Features" in Control Panel or Settings.

You can use PowerShell to uninstall a program with the command: Uninstall-Package -Name

**How to uninstall programs in Windows 10 using PowerShell?** To uninstall a program in Windows 10 using PowerShell, follow these steps: 1. Press `Win + X` keys and select either `Windows PowerShell (Admin)` or `PowerShell (Admin)` to run PowerShell with administrator privileges. 2. In the PowerShell window, type the following command and press Enter. Replace `` with the name of the program you want to uninstall (make sure to use the exact name, or check the program's installation location for the correct package name): ``` Get-AppxPackage -Name | Remove-AppxPackage ``` 3. If PowerShell prompts you for confirmation, type `Y` and press Enter to proceed with the uninstallation. 4. Once the program is uninstalled, PowerShell will display a confirmation message. If you're uninstalling a traditional desktop application, try this command instead: ``` Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -like "" } | ForEach-Object { $_.Uninstall() } ``` Again, replace `` with the name of the program you wish to uninstall and confirm the action when prompted. Please note that using an incorrect program name may result in the uninstallation failing, so ensure you use the precise and correct name. If unsure about the program's name, you can look it up in the "Uninstall Programs" list within the Control Panel, or use the `Get-AppxPackage` command without the `-Name` parameter to list all installed apps and find the correct package name.

In the PowerShell window, use the commands Get-AppxPackage followed by the name of the app and Remove-AppxPackage, then hit Enter to directly uninstall the target program.

How do I uninstall an .exe file in Windows 11?

.exe is the file extension for executable files. There are two ways to uninstall it. First, go to Settings and click the Uninstall button from the list of applications. Secondly, if it's a possible program, simply deleting the .exe file or the folder containing the program can accomplish the uninstallation.

**How to delete a file in Windows 11 using the Command Prompt?** In Windows 11, you can delete a file using the Command Prompt. Follow these steps: 1. Open the Command Prompt as an administrator: - Press the `Win + X` keys together and then select "Windows Terminal (Admin)" or "Command Prompt (Admin)." If you're using a touch device, long-press the "X" icon, and then choose the administrator mode. - If prompted for administrator permissions, click "Yes." 2. In the Command Prompt window, type the following command, replacing "filename" and "path" with the actual name and path of the file you want to delete: ``` del /q "path\filename" ``` For example, if you want to delete a file named "example.txt" on your desktop, the command would be: ``` del /q "C:\Users\YourUsername\Desktop\example.txt" ``` 3. Press the `Enter` key to execute the command. The `/q` parameter silently deletes the file without displaying a confirmation prompt, in case there are other files in the folder. Please note that files deleted using the Command Prompt are usually not recoverable unless you have a backup. Therefore, exercise caution.

You can delete a file in Windows 11 by opening the Command Prompt and entering the `DEL /F filename` command, followed by pressing the Enter key.