$cs.CustomInventory_RemoveInstance
Description
Section titled “Description”Removes a custom inventory instance with all its values, and the category when it has no instances left. Does nothing if the instance 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_RemoveInstance(string category, string instance)
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.
instance (String)
Section titled “instance (String)”Name of the instance to remove. Pass "" for the instance default, which a category with only one instance uses. Same rules as category.
Return value
Section titled “Return value”None. Throws an error if an argument isn’t valid, for example an empty category.
Example
Section titled “Example”Removing an application’s instance during Uninstall:
$cs.CustomInventory_RemoveInstance('Installed Applications', '7-Zip')Related functions
Section titled “Related functions”$cs.CustomInventory_RemoveValue $cs.CustomInventory_RemoveCategory $cs.CustomInventory_GetInstanceNames