none
List all installed APPX packages, along with their display names RRS feed

  • Question

  • Hi.

    So, some of you probably know how to inventory APPX packages in PowerShell:

    Get-AppxPackage -AllUsers

    The only problem is that the output might look like this:

    Name                   : 91750D7E.Contoso
    Publisher              : CN=D25A1379-D5D0-455B-826A-BFFC7EBB5712
    Architecture           : X64
    ResourceId             :
    Version                : 4.0.0.0
    PackageFullName        : 91750D7E.Contoso_4.0.0.0_x64__8zze8kybcnzg4
    InstallLocation        : C:\Program Files\WindowsApps\91750D7E.Contoso_4.0.0.0_x64__8zze8kybcnzg4
    IsFramework            : False
    PackageFamilyName      : 91750D7E.Contoso_8zze8kybcnzg4
    PublisherId            : 8she8kybcnzg4
    PackageUserInformation : {S-1-5-21-9999999960-100467071-9931694243-1009 [Bill.Gates]: Installed}
    IsResourcePackage      : False
    IsBundle               : False
    IsDevelopmentMode      : False
    NonRemovable           : False
    IsPartiallyStaged      : False
    SignatureKind          : Store
    Status                 : Ok

    Now, which app is 91750D7E.Contoso? How can I have PowerShell discover the display name of the app?

    My first idea was to read the Manifest.xml file, but in most cases, I came up with names like "ms-resource:ApplicationTitleWithBranding" or "ms-resource:ApplicationTitleShort".

    I also tried peeking into the underlying classes, but any attempt to invoke .GetType() on them fails. Apparently, Windows Runtime does not expose this kind of metadata.



    Thursday, July 25, 2019 11:43 PM

Answers

  • I found the answer.

    The weird strings starting with ms-resource: are potions of what Microsoft calls "indirect strings". They resolved via the SHLoadIndirectString function.

    It was tricky, but I eventually figured it out. I think I am going to write a full blog post on it because there are credits due.

    Update: I've posted a full script for this purpose on my GitHub repo.


    • Marked as answer by Fleet Command Sunday, August 4, 2019 4:21 PM
    • Edited by Fleet Command Thursday, December 5, 2019 12:57 PM Full answer
    Sunday, August 4, 2019 4:21 PM

All replies

  • Get-AppxPackage | Get-AppxPackageManifest | 
        ForEach-Object{
            $_.Package.Applications.Application.VisualElements.DisplayName
        }


    \_(ツ)_/

    Friday, July 26, 2019 12:02 AM
  • @jrv Hi. I specifically said that this approach is faulty. (See my original post to for details.)

    Sample output:

    ms-resource:DisplayName
    Gill Sans Nova
    Rockwell Nova
    Georgia Pro
    Nina
    Arial Nova
    Convection
    Verdana Pro
    Get-AppxPackageManifest : The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
    At line:3 char:12
    +         $a=Get-AppxPackageManifest -Package $_
    +            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Get-AppxPackageManifest], FileNotFoundException
        + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.Windows.Appx.PackageManager.Commands.GetAppxPackageManifestCommand
    
    ms-resource:AppStoreName
    ms-resource:DisplayName
    ms-resource:AppStoreName
    Hotspot Shield Free VPN
    ms-resource:AppStoreName
    ms-resource:DisplayTitle
    ms-resource:ApplicationTitleShort
    ShareX
    ms-resource:AppName/Text
    ms-resource:AppName/Text
    ms-resource:AppStoreName
    ms-resource:AppName
    ms-resource:AppDisplayName
    ms-resource:AppName/Text
    ms-resource:AppListName
    ms-resource:AppStoreName
    ms-resource:AppStoreName
    CrystalDiskMark
    ms-resource:LensSDK/Resources/AppTitle
    ms-resource:ShortAppname
    ms-resource:AppStoreName
    EarTrumpet
    ms-resource:StoreTitle
    Telegram Desktop
    ms-resource:AppName
    ms-resource:AppFriendlyName
    ms-resource:SecondaryTileDescriptionA
    MSIX Packaging Tool
    MSIX Packaging Tool CLI
    Python 3.7
    Python 3.7 (Windowed)
    pip (Python 3.7)
    IDLE (Python 3.7)
    ms-resource://microsoft.windowscommunicationsapps/hxoutlookintl/AppManifest_MailDesktop_DisplayName
    ms-resource://microsoft.windowscommunicationsapps/hxoutlookintl/AppManifest_CalendarDesktop_DisplayName
    ms-resource://microsoft.windowscommunicationsapps/hxoutlookintl/AppManifest_AccountsDesktop_DisplayName
    WhatsApp Desktop
    ms-resource:AppxManifest_DisplayName
    ms-resource:AppxManifest_DisplayName
    ms-resource:AppxManifest_DisplayName
    ms-resource:AppxManifest_DisplayName
    Microsoft Text Input Application
    ms-resource:PackageDisplayName
    ms-resource:DisplayName
    ms-resource:AppDisplayName
    ms-resource:AppDisplayName
    ms-resource:AppDisplayName
    ms-resource:AppDisplayName
    ms-resource:AppDisplayName
    ms-resource:TileDisplayName
    ms-resource:AppName
    ms-resource:AppName
    ms-resource:ProductName
    ms-resource:DisplayName
    ms-resource:DisplayName
    ms-resource:DisplayName
    ms-resource:DisplayName
    ms-resource:PackageDisplayName
    ms-resource:AppDisplayName
    CapturePicker
    ms-resource:appDisplayName
    ms-resource:AppDisplayName
    ms-resource:TileDisplayName
    ms-resource:RemindersUIResources/RemindersShareTargetApp_AppTileDisplayName
    ms-resource:AppDisplayName
    ms-resource:AppDisplayName
    ms-resource:AppDisplayName
    ms-resource:DisplayName
    ms-resource:AppName/Text
    PinningConfirmationDialog
    ms-resource:DisplayName
    ms-resource:PackageDisplayName
    ms-resource:AppName/Text
    ms-resource:StartMenuExperienceHost/AppName/Text
    ms-resource:AppxManifest_DisplayName
    ms-resource:PkgDisplayName
    Windows Barcode Preview
    Microsoft Pay
    ms-resource:AppName
    Xbox Game bar
    Sticky Notes


    Friday, July 26, 2019 1:01 AM
  • That is what you asked for. That is the DisplayName property of n APPX package. The names are correct and there is no other type of DisplayName.

    If you are looking for the Windows Title that can only be gotten by running the APP.


    \_(ツ)_/

    Friday, July 26, 2019 1:25 AM
  • @jrv Thanks for trying, but I explicitly said what you posted isn't what I want.

    As a clarification, "display name", in the context of my post, is the one displayed in the Start menu, in the Apps and Features list, in App History, in App Library and in the Microsoft Store page corresponding to that app.

    Friday, July 26, 2019 6:18 AM
  • I Windows the Start Menu name is created by the Installer and has can be anything that the installer technology wants to make it.  An APPX package has a very specific schema and properties which does not include the name used in the Start menu and in any Shortcuts created.

    If you look at the list returned by my script many of the names WILL be what is in the Start menu.  "Skype", for example, is the same.

    Example:

    Get-AppxPackage | Get-AppxPackageManifest |
        ForEach-Object{
            $_.Package.Applications.Application.VisualElements.DisplayName
        } |
        Where-Object{
            $_ -notmatch '^ms'
        }

    Also note that only the new "APPX" programs (aka "Store Apps") are returned by this command.  Programs installed by MSI and other methods are no APPX packages.


    \_(ツ)_/


    • Edited by jrv Friday, July 26, 2019 10:12 AM
    Friday, July 26, 2019 10:10 AM
  • @jrv Your script fails to expose commonly installed apps such as Alarms & Clocks, Paint 3D, Calculator, Camera, Maps, or Snip & Sketch. Already, 3rd-party utilities can easily collect this information, hence it must be possible.

    There is no shame in not knowing the answer; but your latest "reply" promotes a script that fails to collect desirable results and covers it up too. I find it pretentious and deceitful.

    Friday, July 26, 2019 11:25 AM
  • Yes. There are ways to do this. You asked about APPX commands and the DisplayName. I answered you question. Now you are asking a different question. To get that answer you will have to write a complex script that can probe deeply into the registry and other places and combine that information.

    Most programs in Windows are not APPX packages.

    Before complaining understand that you are asking a question that cannot give you what you want because you are asking the wrong question. Try asking a question that describes what you are actually trying to do and not one that just complains that he code you are trying doesn't give you what you want.

    You asked a bunch of questions bout APX packages but it seem that you really want a different set of questions. 

    Also many packages are part of a collection of tools and APPX does not give us any method to discover those components.

    We cannot design a custom solution  for you.  This is one of the reasons for third party tools.  Someone takes the time to write the code and learn the system.  They package this and sell it.  This is a scripting forum.  We cannot design a solution for you.

    I suggest looking at the APPX API to discover how these vendors might do this.  You might be able to discover what they discovered.

    And yes, I cannot give you the answer you are demanding.  That is not my purpose in life.  If you really need this then purchase a third party  app that you know about or pay me or another consultant to do the research necessary to design code that does what you want.

    Remember that you asked exactly "List all installed APPX packages, along with their display name".

    Many programs like "Clock" are part of the OS and not displayed as APPX packages.   You can probably find a WMI class that can return these items.

    For other apps you can do this:

    Get-WmiObject Win32_InstalledWin32Program | Select-Object Name


    \_(ツ)_/

    Friday, July 26, 2019 12:28 PM
  • You can also see that "Alarms & Clocks" is installed as APPX package.

    Get-AppxPackage | 
        Where-Object{$_.Name -match 'Microsoft.Windows'} |
        Select-Object @{n = 'name'; e = {$_.Name -replace 'Microsoft\.Windows\.'|Microsoft\.}} |
        Sort-Object Name


    \_(ツ)_/


    • Edited by jrv Friday, July 26, 2019 12:43 PM
    Friday, July 26, 2019 12:41 PM
  • If you are just looking for "StartApps" then use this command:

    Get-StartApps

    This will show all apps installed in the "Start" menu for the current user.  This will not give you all APPX packages or installed programs.


    \_(ツ)_/

    Friday, July 26, 2019 12:50 PM
  • You can also see that "Alarms & Clocks" is installed as APPX package.

    Get-AppxPackage | 
        Where-Object{$_.Name -match 'Microsoft.Windows'} |
        Select-Object @{n = 'name'; e = {$_.Name -replace 'Microsoft\.Windows\.'|Microsoft\.}} |
        Sort-Object Name


    \_(ツ)_/


    Friday, July 26, 2019 1:19 PM

  • \_(ツ)_/

    Friday, July 26, 2019 2:03 PM

  • \_(ツ)_/

    Friday, July 26, 2019 2:07 PM
  • Now, the question is: How does Get-StartApps resolve "Microsoft.YourPhone_8wekyb3d8bbwe!App" to "Your Phone"?

    I tried to refactor a C# code (from Code Gallery) that does what I want to PowerShell. Here is the result, but unlike the C# version, it does not work:

    $Packages=Get-AppxPackage -PackageTypeFilter Main
    $PackageManager = New-Object Windows.Management.Deployment.PackageManager
    foreach ($Package in $Packages) {
      Write-Output $Package.PackageFullName
      try {
        $PackageUWP = $PackageManager.FindPackage($Package.PackageFullName)
        Write-Output $PackageUWP.DisplayName
        Write-Output ''
      }
      catch {
        throw
        break
      }
    }
    Remove-Variable Packages,PackageManager,Package,PackageUWP

    Edit: Of course, it does not work because if you call the DisplayName property on an instance of a package that was created by any mechanism other than Package.Current, this property returns an empty string (""). Bummer!


    Friday, July 26, 2019 2:20 PM
  • I found the answer.

    The weird strings starting with ms-resource: are potions of what Microsoft calls "indirect strings". They resolved via the SHLoadIndirectString function.

    It was tricky, but I eventually figured it out. I think I am going to write a full blog post on it because there are credits due.

    Update: I've posted a full script for this purpose on my GitHub repo.


    • Marked as answer by Fleet Command Sunday, August 4, 2019 4:21 PM
    • Edited by Fleet Command Thursday, December 5, 2019 12:57 PM Full answer
    Sunday, August 4, 2019 4:21 PM