Get WindowsPackage - PowerShell
Overview
Get-WindowsPackage retrieves information about installed Windows 10/11 packages and Microsoft Store apps. It provides insights into installed packages, their properties, and allows for easy management and troubleshooting.
Syntax
Get-WindowsPackage [-Name] <PackageFullName> [[-ProviderName] <PackageProviderName>][-License] <PackageLicenseName> [-PackageUser Sid] <PackageUserSid> [-EffectiveUser Sid] <EffectiveUserSid> [-OnlyShowApps] [-OnlyShowWindowsPackage] [-OnlyShowFramework] [-OnlyShowDeveloperMode] [CommonParameters]
Options/Flags
- -Name
<PackageFullName>
: Specifies the full name of the package to retrieve information about. Omit this parameter to retrieve all installed packages. - -ProviderName
<PackageProviderName>
: Filters results based on the provider name. For example,-ProviderName Microsoft
retrieves packages from Microsoft. - -License
<PackageLicenseName>
: Filters results based on the license name. For example,-License Full
retrieves packages with a full license. - -PackageUser Sid
<PackageUserSid>
: Filters results based on the user’s SID associated with the package. - -EffectiveUser Sid
<EffectiveUserSid>
: Filters results based on the effective user’s SID associated with the package. - -OnlyShowApps: Filters results to display only non-Windows packages (apps).
- -OnlyShowWindowsPackage: Filters results to display only Windows packages.
- -OnlyShowFramework: Filters results to display only framework packages.
- -OnlyShowDeveloperMode: Filters results to display only packages installed in developer mode.
Examples
Example 1: Get all installed packages
Get-WindowsPackage
Example 2: Get information about a specific package by name
Get-WindowsPackage -Name Microsoft.Windows.Photos
Example 3: Get packages installed by a specific user
Get-WindowsPackage -PackageUser S-1-5-21-3002707997-3690068695-3855572957-1001
Example 4: Get only Windows packages with a full license
Get-WindowsPackage -OnlyShowWindowsPackage -License Full
Common Issues
- Missing package information: Some packages may not have complete or accurate information available.
- Wrong SID format: Ensure the SID values provided are in the correct format (e.g., S-1-5-21-*).
Integration
Get-WindowsPackage can be integrated into scripts and workflows for managing software deployments and troubleshooting package-related issues. For example, it can be combined with commands like Remove-WindowsPackage or Add-AppxPackage for automated package management.
Related Commands
- Add-AppxPackage: Installs an app package from a file path.
- Remove-WindowsPackage: Removes a Windows package.
- Find-AppxPackage: Finds app packages installed on the system.
- Windows Package Manager Documentation