Get WindowsCapability - PowerShell


Overview

Get-WindowsCapability retrieves information about the capabilities installed on a Windows system. This command is particularly useful for understanding the system’s installed features, checking for specific capabilities, or managing the availability of apps and features.

Syntax

Get-WindowsCapability [[-Name] <string[]>] [-Online] [-IncludeDependencies] [-ExcludeDependencies] [-ShowVersion]
[-ShowInstalledDate] [-ShowProvisionedDate] [-ShowAvailability] [-ShowDescription] [-ShowLicenseInfo] [-Component]
[-Force] [-Expand] [-OutFile <string>]

Options/Flags

  • -Name: Specifies the name of a specific capability or an array of names to retrieve information for multiple capabilities.
  • -Online: Forces an online check for the latest capability data. By default, offline data is used for faster results.
  • -IncludeDependencies: Includes dependency capabilities in the output.
  • -ExcludeDependencies: Excludes dependency capabilities from the output.
  • -ShowVersion: Displays the version of each capability.
  • -ShowInstalledDate: Displays the installation date of each capability.
  • -ShowProvisionedDate: Displays the provisioned date of each capability.
  • -ShowAvailability: Displays the availability status of each capability (e.g., installed, provisioned).
  • -ShowDescription: Displays the description of each capability.
  • -ShowLicenseInfo: Displays the license information of each capability.
  • -Component: Displays the component name of each capability.
  • -Force: Continues the operation even if errors occur.
  • -Expand: Expands the output to include all properties for each capability.
  • -OutFile: Saves the output to the specified file.

Examples

Retrieve information about a specific capability:

Get-WindowsCapability -Name "AppManagement"

Retrieve information about multiple capabilities:

Get-WindowsCapability -Name AppManagement,Provisioning

Retrieve detailed information about a capability, including dependencies and license info:

Get-WindowsCapability -Name AppManagement -IncludeDependencies -Expand -ShowLicenseInfo

Check for the existence of a capability:

if (Get-WindowsCapability -Name "Microsoft-Windows-HolographicFirstRun") {
    Write-Host "Holographic First Run capability is installed"
}

Common Issues

  • Inconsistent output: The command may return different results when run online and offline due to caching of capability data. Use -Online to ensure the latest data is used.
  • Capability not found: If a specified capability does not exist, the command will return an error. Verify the name or use -Force to suppress errors.
  • Access denied: Ensure that PowerShell is run with elevated privileges to access all capability information.

Integration

  • Use the output of Get-WindowsCapability to create a list of installed capabilities.
  • Combine with Install-WindowsCapability to install additional capabilities.
  • Integrate with Disable-WindowsCapability or Uninstall-WindowsCapability to manage capability availability.
  • Install-WindowsCapability
  • Uninstall-WindowsCapability
  • Enable-WindowsCapability
  • Disable-WindowsCapability