PS3 MOL: Lab Questions CH 14.9 get-CimClass error

having trouble getting ex 1 working :

Lab answer says: Get-CimClass win32_networkadapterconfiguration | select -expand methods | where Name -match “dhcp”

which errors on “methods”

Get-CimClass win32_networkadapterconfiguration | select -expand method |
where Name -match “dhcp”

which errors on “method”

select : Property “methods” (or “method”) cannot be found.

It should be

Get-CimClass Win32_networkadapterconfiguration | select -ExpandProperty CimClassMethods | where Name -match “dhcp”

try running

Get-CimClass Win32_networkadapterconfiguration

and you’ll see the two major groups are
CimClassMethods and CimClassProperties

You could simplify the code to
(Get-CimClass Win32_networkadapterconfiguration).CimClassMethods | where Name -match “dhcp”

ah! CimClassMethods

thanks Richard,