So now that we know how to use the basic Invoke‑Command,
now let's look at how the CIM PowerShell modules can help us with this.
The first thing is to understand the CIM commands.
The Common Information Model, or the CIM commands,
are part of an open source standard for accessing and
displaying information about a computer.
The CIM classes are the parent classes with which
WMI classes were actually built.
CIM data breaks down into what's called CIM classes.
So let's say, for example,
a USB device connected to a machine would have CIM data,
but there would be a CIM class to be able to access that information.
CIM classes hold categories of the Windows
information that we're trying to get to.
So when using CIM commands, we have our Get‑CimClass,
which will allow us to pick the class that we're trying to get to,
and then the Get‑CimInstance will allow us to get the
instance of the class that we've chosen.
Now the first CIM command that we need to look at is the Get‑CimClass.
Now as we talked about,
the Get‑CimClass allows us to see all of the classes that are available.
What it also allows us to do, if I just come back here and say Get‑SimClass,
is to actually specify a class name.
And then because I may not know what the class name is I'm looking for,
you can see that I can use this kind of star mechanism.
So I can say Win32 because that's obviously the prefix, and then I'm
looking for everything that has the word system.
So this will allow me to find operating system, computer system, etc.
If I am unsure and maybe I know I want to interrogate the computer,
I can say Computer*, and that will do the same thing and this time get me
everything that's related to Win32_Computer something.
So of course, in that list, you can see ComputerSystem,
you can see ComputerSystemEvent, etc. Now the most important thing
to note here is that we have a CimClassName,
then we have what's called a CimClassMethod, and
then we have CimClassProperties.
So when we're querying information,
the list of properties are important because it will allow us to
see the values or query those values that we need. Now the
CimClassMethods we'll talk about in a minute,
but that allows me to interact with specific things that we've retrieved.