$cs.CustomInventory_RemoveValue
Description
Section titled “Description”Removes a custom inventory value and updates the instance’s Last Updated. Removes the instance when it has no values left, and the category when it has no instances left. Does nothing if the value 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_RemoveValue(string category, string instance, string name)
Parameters
Section titled “Parameters”category (String)
Section titled “category (String)”Name of the category, for example Office. 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 in the category. Pass "" for the instance default, which a category with only one instance uses. Same rules as category.
name (String)
Section titled “name (String)”Name of the value to remove. Can’t be empty, Instance or Last Updated, and can only contain letters, digits, spaces and -: see Names.
Return value
Section titled “Return value”None. Throws an error if an argument isn’t valid, for example an empty name.
Example
Section titled “Example”$cs.CustomInventory_RemoveValue('Office', '', 'Has Parking')Removing a value that no longer applies, during Uninstall:
$cs.CustomInventory_RemoveValue('Installed Applications', '7-Zip', 'Install Duration')The equivalent of CMS_RemoveCustomInventory for an entry written with $cs.CustomInventory_SetValue:
CMS_RemoveCustomInventory -category 'Bitlocker' -entry 'TPM Chip - Enabled'$cs.CustomInventory_RemoveValue('Bitlocker', '', 'TPM Chip - Enabled')Related functions
Section titled “Related functions”$cs.CustomInventory_SetValue $cs.CustomInventory_RemoveInstance $cs.CustomInventory_RemoveCategory CMS_RemoveCustomInventory