Boolean Value for Graphics adapter

Hi,

I’m trying to get the WMI value of the PC’s graphics adapter, and place that value to a true/false condition, but it is just not working.

Here’s what I have from QnA:

(string values of selects “Name from Win32_VideoController” of wmi contains “Intel”)
E: A singular expression is required.

“A singular expression is required.” does nothing for me as far as determining what the problem actually is. What am I doing wrong? thanks

Try
(string values of selects “Name from Win32_VideoController” of wmis) whose (it as lowercase contains “intel”)

When you use a “whose” clause it has to be followed by an it statement. Singular expression errors are often just down to you trying to reference something that doesn’t exist.

Relevance is a bit of a learning curve :slight_smile:

ETA:
By the way, I personally prefer the win32_pnpsigneddriver class, at it allows me to also inspect things like driver version and date. There is an added cost in terms of evaluation overhead, so may or may not be applicable to you if all you care about is name, but here is your query vs the query we run.

Q: (string values of selects “Name from Win32_VideoController” of wmis)
A: ATI Radeon HD 3450 - Dell Optiplex
T: 0.020 ms

Q: ((string values of property “Description” of it) of ((select objects “Description, DeviceClass from Win32_PnPSignedDriver” of wmi) whose (string value of property “DeviceClass” of it = “DISPLAY”)))
A: ATI Radeon HD 3450 - Dell Optiplex
T: 0.033 ms

Q: ((string values of property “DriverVersion” of it) of ((select objects “DriverVersion, DeviceClass from Win32_PnPSignedDriver” of wmi) whose (string value of property “DeviceClass” of it = “DISPLAY”)))
A: 8.922.0.0
T: 0.034 ms

(string values of selects “Name from Win32_VideoController” of wmi contains “Intel”)

In this case, string values of selects “Name from Win32_VideoController” of wmi is a plural result. You cannot check whether a plural contains a string (contains “Intel”)

You might thing of your video controller as “just one thing”, but by using “valueS” and “selectS” you are making it a plural. Suppose you actually had more than one video card, you could end up with a comparison like (“Intel Integrated Graphics”;“ATI”;“NVidia”) contains “Intel”

What you actually need to check is whether any of the results contain Intel, which can be expressed as
exists (string values of selects "Name from Win32_VideoController" of wmi) whose (it contains "Intel")f wmi is a plural result`