Dela via


InstalledDesktopApp.GetInventoryAsync Method

Definition

Gets a list of installed Win32 apps available to the current user. This includes apps installed for all users as well as only for the current user.

public:
 static IAsyncOperation<IVectorView<InstalledDesktopApp ^> ^> ^ GetInventoryAsync();
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<IVectorView<InstalledDesktopApp>> GetInventoryAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<IReadOnlyList<InstalledDesktopApp>> GetInventoryAsync();
function getInventoryAsync()
Public Shared Function GetInventoryAsync () As IAsyncOperation(Of IReadOnlyList(Of InstalledDesktopApp))

Returns

Returns an async operation indicating that the task has completed and containing a list of installed Win32 apps available to the current user.

Attributes

Examples

IReadOnlyList<InstalledDesktopApp> installedApps = await InstalledDesktopApp.GetInventoryAsync();

foreach (var app in installedApps)
{
    Console.WriteLine("Display Name: " + app.DisplayName);
    Console.WriteLine("Application ID: " + app.Id);
    Console.WriteLine("Publisher: " + app.Publisher);
    Console.WriteLine("Display Version: " + app.DisplayVersion);
}

Remarks

The list includes apps installed for all users as well as only for the current user.

Applies to