Skip to content

Commit 8606ada

Browse files
PackageManager.FindPackages: clarify user scope and parameter formats
Addresses community feedback (MicrosoftDocs/windows-dev-docs#5503): 1. FindPackages() — fix incorrect description ('specified family' copied from sibling overload); add note that results span all users. 2. FindPackages(String familyName) — add NOTE callout clarifying that packageFamilyName = Package.Id.FamilyName (not Name or FullName); wrong format silently returns empty collection. 3. FindPackages(String name, String publisher) — empty Remarks filled in: - All-users scope (not current user) now stated explicitly - packageName = Package.Id.Name (not FullName) - packagePublisher = Package.Id.Publisher (full X.500 DN, not PublisherId) - Recommend FindPackages(FamilyName) as simpler alternative Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d993f18 commit 8606ada

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

windows.management.deployment/packagemanager_findpackages_1246181969.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ public Windows.Foundation.Collections.IIterable<Windows.ApplicationModel.Package
1010
# Windows.Management.Deployment.PackageManager.FindPackages
1111

1212
## -description
13-
Retrieves information about a specified family of [Packages](/uwp/api/windows.applicationmodel.package) installed across all users.
13+
Retrieves information about all [Packages](/uwp/api/windows.applicationmodel.package) installed across all users.
1414

1515
## -returns
1616
If the method succeeds, an enumerable collection of package objects is returned. Each Package object in this collection contains information about the package, including but not limited to its name, publisher, version, and install location.
1717

1818
## -remarks
1919
This method requires administrative privileges. Otherwise, an **AccessDeniedException** is thrown.
2020

21+
This method returns packages installed for **all users** on the device. To retrieve packages for a specific user only, use [FindPackagesForUser](packagemanager_findpackagesforuser_292215772.md).
22+
2123
## -examples
2224
This example uses FindPackages() to enumerate the installed packages for all users.
2325

windows.management.deployment/packagemanager_findpackages_1597689551.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@ The package publisher. This parameter cannot be **null**.
2323
If the method succeeds, an enumerable collection of package objects with the same package name and publisher name is returned. Each Package object in this collection contains information about the package, including but not limited to its name, publisher, version, and install location. If no packages with the specified name and publisher are found, this method returns an empty list.
2424

2525
## -remarks
26-
This method requires administrative privileges.
26+
This method requires administrative privileges. This method returns packages installed for **all users** on the device, not just the current user. To retrieve packages for a specific user only, use [FindPackagesForUser](packagemanager_findpackagesforuser_292215772.md).
27+
28+
> [!NOTE]
29+
> Parameter formats matter — passing the wrong format silently returns an empty collection:
30+
>
31+
> - The *packageName* parameter corresponds to [Package.Id.Name](/uwp/api/windows.applicationmodel.packageid.name) — for example, `Microsoft.WindowsCalculator`. This is **not** [Package.Id.FullName](/uwp/api/windows.applicationmodel.packageid.fullname) (which includes version and architecture).
32+
> - The *packagePublisher* parameter corresponds to [Package.Id.Publisher](/uwp/api/windows.applicationmodel.packageid.publisher) — the full X.500 distinguished name string, for example, `CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US`. This is **not** [Package.Id.PublisherId](/uwp/api/windows.applicationmodel.packageid.publisherid) (the hashed short form).
33+
>
34+
> Use [FindPackages(String)](packagemanager_findpackages_331793265.md) with [Package.Id.FamilyName](/uwp/api/windows.applicationmodel.packageid.familyname) as a simpler and less error-prone alternative when you don't need to match on publisher separately.
2735
2836
## -examples
2937

windows.management.deployment/packagemanager_findpackages_331793265.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ If the method succeeds, an enumerable collection of package objects with the sam
2222
## -remarks
2323
This method requires administrative privileges. Each package in the [IIterable(Package)](../windows.foundation.collections/iiterable_1.md) collection may be installed for the current user or for another user. This method differs from [FindPackages(String packageName, String pulisherName)](packagemanager_findpackages_1597689551.md) method. Here the *packageFamilyName* parameter is a single string, comprised of the package name and package publisher hash.
2424

25+
> [!NOTE]
26+
> The *packageFamilyName* parameter corresponds to [Package.Id.FamilyName](/uwp/api/windows.applicationmodel.packageid.familyname) — for example, `Microsoft.WindowsCalculator_8wekyb3d8bbwe`. This is **not** the same as [Package.Id.Name](/uwp/api/windows.applicationmodel.packageid.name) (e.g., `Microsoft.WindowsCalculator`) or [Package.Id.FullName](/uwp/api/windows.applicationmodel.packageid.fullname) (which includes version and architecture). Passing an incorrect format silently returns an empty collection.
27+
2528
## -examples
2629

2730
## -see-also

0 commit comments

Comments
 (0)