Windows XP

Get A List Of Software Installed On Windows And Uninstall Software Using Powershell

The Get-AppxPackage cmdlet can be used to obtain a list of all apps installed on a Windows host. In the following example, we’ll look at the apps installed for all users using the -AllUsers option.

Get-AppxPackage -AllUsers

The output includes a Name, the name of the publisher, along with a location, the architecture, the version, the full name, the status, whether the software is signed, whether the development mode is enabled (useful when testing), the id of the publisher, the family, etc.

Next we’ll do a Select against the found set. You can use so stdout displays the Name and the unique identifier, which we can then use to programmatically work with the package if needed (you can choose any of the metadata from the previous command in the select):

Get-AppxPackage -AllUsers | Select Name, PackageFullName

If you want, you can use -User instead of -AllUsers, to see the output of just a given package. One challenge with using Get-Appxpackage is that you don’t get the actual “Product Name” so if you, for example, wanted to uninstall a program, you’d need to hop into WMI. First, let’s use gwmi to find a product with the word Krypted in the name:

$Key = Get-WmiObject -Class Win32_Product | Where-Object {
$_.Name -match "Krypted"
}

Next, let’s use the $Key from the output to uninstall the software:

$Key.Uninstall()