[Autogenerated] So let's go back onto our
Windows 10 machine on. We'll look at how
we execute some of the basic w my
commands. Okay, so we're back on the
Windows 10 machine, and I've already
launched the windows terminal and actually
have two tabs open now in the windows
terminal. When we choose the menu, we get
windows PowerShell and of course, windows
PowerShell seven. And the reason I wanted
to do this is to kind of show you the
difference between the two. Now, first
off, if I type in, get W my object, it
kind of auto fills that for me. And then
what we'll do is just do a simple thing.
So class and I'll say win 32 underscore
process, and we'll just end to that. So
that gives me I'm not gonna wait for that
to finish. I'm just gonna kinda kill that.
But you notice that that cmdlet executed
perfectly fine. Now what I'm gonna do, he
is just copy this command. I'm gonna go to
my PowerShell seven and paste that in and
then choose enter and notice what happens
in the PowerShell seven side. The W M I
object commands don't actually exist in
PowerShell. Seven. They're not part off
the PowerShell call, so that's an
important thing to member. So as we talk
about WMD commands and executing them,
it's really focused on Windows PowerShell,
which is the one that's provided by
Windows 10 or your operating system. And
then Windows seven is the updated one that
you download and add to your machine. So
let's kind of talk about executing these
processes then. So some of the commands,
of course, as you notice we just did the
GitHub e m I objects. If I just enter
that, it's gonna ask me for the class,
which is the most common property now what
we can do member when utilizing PowerShell
is we can actually say get help and then
pass the command that we wish to get the
help for on what this will do is give us a
list of the properties that are available
so that we can then determine how we wish
to execute this command. So, as you can
see, there's a whole host of different
types of properties that are available
running things such as amended list or
retrieving specific properties, passion,
credentials, etcetera. So let's get rid of
that and would actually look at running
this command just to retrieve some basic
information. So the first thing I want to
do is actually just retrieve a list off
the W my classes that are available now.
This list goes on for ages and ages and
ages. As you can see it going on here,
this returns back all of the classes that
are available inside that default name
space. If we scroll all the way up here,
I'm going to go to my scroll and just go a
bit further. You can see that we've got
same underscore ones that we looked at
previously and then win 32 options as
well. So what we can do is without having
to go through all of those. I could go
back and say class and then I can type Win
32 underscore. And then, of course, what I
could do. We say, I just want to look for
the wind 32 versions and do that now.
Notice what happens. It says there's an
invalid query in trying to retrieve that
information, and that's perfect because
the class parameter doesn't accept kind of
a wild card type search. So how do we get
the list of all of them? Well, what we can
do is go back to the W my object option.
That's their we can say list, which we
want to do. And then we actually going to
do a pipe command and push that out. So
using the pipe commander means that what
comes back in the w my object list, we're
going to pass to somewhere else. Then I'm
going to say where object on the where
Objects syntax. Obviously he's wrapped
around with curly brackets. I'm gonna do
dollar underscore dot Which means that's
going to no iterate the properties that
are available I'll do a match on this one,
and then what we'll do is I can do some
syntax here to retrieve what I'm looking
for. So I'm gonna look for something that
has win 32 with it. Now, when I enter that
option, you can see it keep scrolling
because there's loads off them. So let me
just kill that one. But if I go back
towards the top of the list here and
scroll, you can see what we're looking at.
So let's go further to the top. There we
do. So let's kind of stop about here so
you can see the types off classes and name
spaces that are available to us. So, for
example, system bias system users, system
devices, etcetera and processes. These are
the ways of us retrieving kind of
information by using the basic commands.
So if we clear this, let's go a little bit
further. Now the GitHub, my object,
actually has a few more parameters and
properties that we can utilize. The first
one is the name space. So I can say, Well,
let's specify the route name, space, and
then what I'm gonna do is do class and
remember that what I want to be able to do
here is just type the word name space it
does actually have. If we go back here,
you can see it's to underscores, but it
makes it into a single line, and so that
allows me to retrieve all the items that
are there. If I do this, it's going to go
crazy and give me a whole list of
different name spaces. It's the X same
list that we looked at previously, except
what it gives us now is lots of the
property values that are associated to it
as well. Okay, so let's go. One step kind
of further. So what about if we wanted to
perform a query instead? So we can say
GitHub my object. And this time we're
going to use that other parameter, That
query option. Now, I mentioned before that
we can utilize SQL type syntax to be able
to get the information. So I'm gonna say
select star from the name space, and then
I'm gonna set my name space to be that
route. So this is another way of
retrieving the same thing. So we have to
specify the name, space or the class, or
we do a query. So when a press center, we
get the same information, come back again.
So it's fairly straightforward in the way
that it would be utilized. So let me kind
of clear this again and will say get W m I
object again. And this time around, we're
just gonna pick one of those kind of
containers to actually look at. So the
first way of doing this is is we can go in
and say I want to get this specific
object. Win 32. I'm going to say operating
system and press center. Now that will
return the subset of information now
notice it has some properties that come
back. So how do we get the properties?
Well, we could pipe it out right here so I
could say, object on then I could say
property on. Then let's say version and do
enter, and that will retrieve the single
property. If I wanted to, I could just a
select object version and do the same
thing. So that dash property option isn't
necessarily required to retrieve the
specific value. So it's fairly
straightforward in the way that we can
retrieve specific information. Now, if we
just choose GitHub to to be my object and
pass that container, it will just give us
all of the properties. So that is the same
process that we can utilize. If I say
process, it will list me all of the
processes, and you can see all of the
properties going crazy on the screen for
every single one. Now, of course, that's
not a great view. So we can once again
format table, so I can do this way, and
then if we scroll up, you can see we get a
different kind of layout I went too far.
Then let me just go a bit further back.
Uh, there we do this kind of table, so win
32 process. And it takes all of those
properties that we kind of saw previously
and put them in a table format instead. So
we have different ways of retrieving the
same thing. Now, if I wanted to get that
same information but not do it that way,
maybe I don't want to use a select. Or
maybe I don't want to just type win a
parading system, etcetera. Then we could
actually say I'm looking for a specific
property instead. So let's let's set our
name space a bit too close There. Name
space on the name space we can use this
syntax. So we can say root slash and then
whatever that kind of container is Now, if
you remember the containers when we looked
at the w, my kind of the same explorer. So
what we can do is, say, security center,
too, and I can say list. And this will
retrieve all of the parameters and the
properties that are available. And you can
see we've got anti virus product, anti
spyware and firewall. So let's change our
query because what I want to be able to do
is just retrieve that. So I can now say,
go and get this name space. We've already
filtered it down by using that path syntax
and then I can say, the class that I'm
looking for is anti virus product. And
then what that will do is give us just the
data for the anti virus product and you
can see it gives me a break down its
Windows defender. And that was the time
stamp. And this is the name of the
computer. So running some of the basic
commands would allow you to retrieve
specific information from the machine that
you're actually connected to. And this is
one of the most common types of actions
that you would run using W. M. I. Is to query and retrieve information.