Share via

Get-AppxPackage and the -PackageTypeFilter parameter questions.

LangsGalgEnRad 21 Reputation points
2022-06-24T14:01:42.637+00:00

I am making a list of app packages installed on my system. In this specific case the ZuneMusic packages. I use the following command:

Get-AppxPackage -AllUsers -PackageTypeFilter Main, Bundle, Resource, Framework  |   
            Where-Object {$_.Name -like "*ZuneMusic*"}   

This will get me a list/result with 4 packages (See attachment). I can see some have IsResourcePackage : True and one has IsBundle : True etc.
This has to do with the options given with the -PackageTypeFilter cause if I use only Main is get only one result.
I Looked up the parameter -PackageTypeFilter and what it does but it is not completely clear to me.

Specifies one or more comma-separated types of packages that the cmdlet gets from the package repository. Valid values are:
Bundle
Framework
Main
Resource
None

  1. Can someone elaborate/explain a bit more what this -PackageTypeFilter parameter does please? It looks in different repositories but on my system or also on the internet?
  2. If I want to delete packages of apps that I do not use or want. Do I use all options of this parameter and delete all the results or is one specific option enough?

214883-installedappslist.txt

Windows for business | Windows Server | User experience | PowerShell

2 answers

Sort by: Most helpful
  1. Rich Matheisen 48,116 Reputation points
    2022-07-02T19:55:59.18+00:00

    To answer your first question, just look at the Description section of the Get-AppxPackage cmdlet.

    The Get-AppxPackage cmdlet gets a list of the app packages that are installed in a user profile.

    The answer to your second question depends on what you're trying to do. If you want to remove all types of the package, then use the -PackageTypeFilter as you did in your example. If you want to remove just the packages that aren't usable on your machine's architecture (e.g., X64, X86, ARM), then make that selection from among the results of the packages using all package types. "Bundles" usually contain everything, though: specific architecture and resources.; so, you can't remove part a bundle.

    Was this answer helpful?

    0 comments No comments

  2. Castorix31 91,871 Reputation points
    2022-07-02T15:15:02.743+00:00

    It just filters the different package types (PackageTypes Enum )
    from C:\Program Files\WindowsApps
    You remove packages from returned PackageFullName with Remove-AppxPackage
    (some can have dependent packages that you must remove first)

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.