$cs.CustomInventory_GetCategory
Description
Section titled “Description”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.
Syntax
Section titled “Syntax”$cs.CustomInventory_GetCategory(string category)
Parameters
Section titled “Parameters”category (String)
Section titled “category (String)”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.
Return value
Section titled “Return value”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.
Example
Section titled “Example”$applications = $cs.CustomInventory_GetCategory('Installed Applications')if ($null -ne $applications) { foreach ($application in $applications.GetEnumerator()) { $cs.Job_WriteLog("$($application.Key): version $($application.Value['Version'])") }}Related functions
Section titled “Related functions”$cs.CustomInventory_GetCategoryNames $cs.CustomInventory_GetInstance $cs.CustomInventory_RemoveCategory