Skip to content

$cs.CustomInventory_GetCategory

CapaOne

Returns all instances of a custom inventory category with their values. Returns $null if the category doesn’t exist. Windows-only.

For how custom inventory is stored in categories, instances and values, see $cs.CustomInventory_SetValue.

$cs.CustomInventory_GetCategory(string category)

Name of the category, for example Installed Applications. Names aren’t case-sensitive. Can’t be empty or longer than 255 characters, and can only contain letters, digits, spaces and -: see Names.

Ordered dictionary (System.Collections.Specialized.OrderedDictionary) of instance name to the instance’s values. The values of each instance are an ordered dictionary of value name to value, as $cs.CustomInventory_GetInstance returns them.

$null if the category doesn’t exist. Throws an error if category isn’t valid.

Terminal window
$applications = $cs.CustomInventory_GetCategory('Installed Applications')
if ($null -ne $applications) {
foreach ($application in $applications.GetEnumerator()) {
$cs.Job_WriteLog("$($application.Key): version $($application.Value['Version'])")
}
}

$cs.CustomInventory_GetCategoryNames $cs.CustomInventory_GetInstance $cs.CustomInventory_RemoveCategory