I’m using the relevance below to return endpoint Video RAM information for an upcoming Windows 7 project. However I have many endpoints retuning an error stating "singular expression refers to a non-unique object. The analysis results, when hoeverd over, will show the proper returned property as well as the error. I am guessing this is due to the fact that the endpoint has multple video adapters.
I need to update the relevance so that the singular expression error is not returned, and I can get a clean output for a csv file or web reports.
(if (it < 128) then ("Insufficient Video Memory. Video Memory in MB: " & (it as string)) else (“Video RAM OK”)) of ((numeric value of (first match (regex “\d+$”) of it) of ((select “adapterram from Win32_VideoController” of wmi) as string)) / 1048576)
will get past the non-unique object issue. However, I’m not sure how your regex will react to that. You might need
first matches
as well. Regardless of the plural/singular syntax issue… do you care which of the multiple adapters you are inspecting with the regex? Because if you do care, you will then need additional logic to deal with checking the size of multiple adapters.
(if (it < 1048576) then ("Insufficient Video Memory. Video Memory in MB: " & (it as string)) else ("Video RAM OK")) of ((numeric values of (first match (regex "\d+$") of it) of ((selects "adapterram from Win32_VideoController" of wmi) as string)))
I removed the division by 1048576 to convert to MB’s since that would require a singular value inside the value returned by the wmi select statement. This will get you over the singular expression error and will return multiple results in the analysis (if multiple values of RAM are present on the system).