# $cs.CustomInventory_GetCategoryNames

> Returns the names of the custom inventory categories on the device. Returns an empty array if there are none. Takes no parameters.

Source: https://docs.capaone.com/capainstaller/powerpacks/cs-custominventory-getcategorynames/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

**CapaOne**

### Description

Returns the names of the custom inventory categories on the device. Returns an empty array if there are none. Takes no parameters. Windows-only.

For how custom inventory is stored in categories, instances and values, see [$cs.CustomInventory_SetValue](/capainstaller/powerpacks/cs-custominventory-setvalue/).

:::note[Collected only by CapaOne]
The function works on any Windows device, also under CapaInstaller, and reads the data in the registry under `HKLM\SOFTWARE\CapaSystems\CapaOneAgent\CustomInventory`. Only the CapaOne agent collects that data, with its hardware inventory. On a device without the CapaOne agent, the data stays in the registry.
:::

### Syntax

$cs.CustomInventory_GetCategoryNames()

### Parameters

None.

### Return value

Array of category names (`string[]`). Empty array if the device has no custom inventory.

### Example

**PowerShell**

```powershell
$categories = $cs.CustomInventory_GetCategoryNames()
$cs.Job_WriteLog("Custom inventory categories: $($categories -join ', ')")
```

Logging the instances of every category:

```powershell
foreach ($category in $cs.CustomInventory_GetCategoryNames()) {
    $instances = $cs.CustomInventory_GetInstanceNames($category)
    $cs.Job_WriteLog("$category has $($instances.Count) instances: $($instances -join ', ')")
}
```

### Related functions

[$cs.CustomInventory_GetCategory](/capainstaller/powerpacks/cs-custominventory-getcategory/) [$cs.CustomInventory_GetInstanceNames](/capainstaller/powerpacks/cs-custominventory-getinstancenames/) [$cs.CustomInventory_RemoveCategory](/capainstaller/powerpacks/cs-custominventory-removecategory/)
