I found a Dell hardware inventory tool that outputs an XML containing all detected components, which allows me to build an analysis containing software and firmware versions, and create fixlets to upgrade these components.
Below is code that WORKS to return the CPLD firmware version:
from XML:
</Device>
<Device componentID="27763" display="System CPLD">
<Application componentType="FRMW" version="1.0.10" display="System CPLD"/>
</Device>
My full code:
if (exists file (data folder of client as string & "\MyCompany\DE_Avigilon\Avigilon.xml")) then ( if ("Avigilon" as trimmed string equals ( (it as string as trimmed string) of value "vendor" of structures "bios_information" of smbios )) then ( if (exists ((node values of attributes "version" of it) of xpaths "/SVMInventory/Device/Application[@componentType='FRMW'][@display='System CPLD']" of xml documents of files (data folder of client as string & "\MyCompany\DE_Avigilon\Avigilon.xml"))) then ( (node values of attributes "version" of it) of xpaths "/SVMInventory/Device/Application[@componentType='FRMW'][@display='System CPLD']" of xml documents of files (data folder of client as string & "\MyCompany\DE_Avigilon\Avigilon.xml") ) else nothing ) else nothing ) else nothing
The meat [@display=‘System CPLD’]:
(node values of attributes "version" of it) of xpaths "/SVMInventory/Device/Application[@componentType='FRMW'][@display='System CPLD']" of xml documents of files (data folder of client as string & "\MyCompany\DE_Avigilon\Avigilon.xml")
The problem is that other components contain additional information in the DISPLAY field that I do not need and cannot figure out how to properly query:
From XML:
<Device componentID="18981" display="Dell OS Driver Pack, 19.10.12, A00">
<Application componentType="APAC" version="19.10.12" display="Dell OS Driver Pack, 19.10.12, A00"/>
</Device>
I need to find the display value that starts with “Dell OS Driver Pack” in @display=“Dell OS Driver Pack, 19.10.12, A00”. This version differs for each version of the OS Driver Pack.
it would be nice to be able to use something like:
(node values of attributes "version" of it) of xpaths "/SVMInventory/Device/Application[@componentType='FRMW'][@display starts with 'Dell OS Driver Pack']"
OR
(node values of attributes "version" of it) of xpaths "/SVMInventory/Device/Application[@componentType='FRMW'][@display='{(it as string starts with "Dell OS Driver Pack")}']"
any assistance is appreciated.