WEBVTT

00:00.510 --> 00:05.790
Start filtering you'll need a way to tell Windows those shall we show objects that you want to keep

00:05.790 --> 00:09.430
and which objects you want to remove from the pipeline.

00:09.540 --> 00:14.340
You do this by specifying criteria for objects that you want to keep.

00:14.430 --> 00:21.290
And most of the time you will do so by using one of the shelves comparison operators you will ask Lachelle

00:21.360 --> 00:25.380
to compare some property of an object to somewhere else.

00:25.440 --> 00:26.740
That is pretty fine.

00:26.820 --> 00:31.600
And if the comparison is true the object is kept is if comparison is false.

00:31.650 --> 00:33.240
The object is removed.

00:33.270 --> 00:36.400
The basic comparison operator is includes the following.

00:36.540 --> 00:46.350
Equal in two not equal to greater than less them less than or equal to and greater than or equal to

00:46.650 --> 00:49.190
be aware of that first string comparisons.

00:49.290 --> 00:57.090
This operators are all case insensitive men and they are not sensitive to case a case sensitive version

00:57.090 --> 01:02.810
of each is available if it is necessary such as dash C.

01:02.850 --> 01:12.650
You will be case sensitive version of equal to Q Or C D C and C not equal to.

01:12.690 --> 01:14.940
Again case sensitive version.

01:14.940 --> 01:22.150
This also contains the dash like operator and its case sensitive comparer companion does.

01:22.180 --> 01:32.580
See like the dust like a barometer resembles dush IQ but supports the use of the question mark and asterisk

01:32.910 --> 01:36.280
wildcard characters in string comparisons.

01:36.280 --> 01:41.700
There are additional more advanced operators that will not be covered at this point.

01:41.700 --> 01:49.110
This includes the following dash in and does contains newsman's just to see whether an object exists

01:49.170 --> 02:00.090
in a collection and thus a test to see whether an object if a particular type and match and does C maj

02:00.330 --> 02:07.290
compare a string to a regular expression literal also contains many operators that reverse the logic

02:07.500 --> 02:15.210
of comparison such as does not like and does not mean comparisons can be made directly as a command

02:15.240 --> 02:16.050
line performed.

02:16.050 --> 02:20.850
For example turn does duty are greater than 1.

02:20.920 --> 02:22.840
True so it will be true.

02:22.950 --> 02:27.320
Hello in quotes is equal to hello in quotes.

02:27.360 --> 02:29.380
All uppercase.

02:29.380 --> 02:37.200
True but hello in quotes case sensitive equal to Hello all Borges is false.

02:37.200 --> 02:42.560
This technique makes it easy to test comparison before you use them in a command.

02:42.660 --> 02:49.620
Let's move on to basic filter and syntax live where the object command and it's early elsewhere has

02:49.620 --> 02:51.080
two syntax forms.

02:51.150 --> 02:55.660
Least two forms are created by having carefully designed parameter sets.

02:55.680 --> 03:02.760
This enables an easy to read syntax for example to display a list of only running services Richert type

03:02.970 --> 03:06.490
get service by their status.

03:06.520 --> 03:08.430
There's Eik you run them.

03:08.490 --> 03:15.980
So we are looking just for services which are our equal status in these basic syntax starts with the

03:15.990 --> 03:22.620
areas where you could also specify the form common name where object followed by the property that you

03:22.620 --> 03:25.190
want windows power shell to compare.

03:25.260 --> 03:33.150
When you specify a comparison operator and the value that you want the shell to compare to every object

03:33.150 --> 03:38.010
that has a specified well specified property will be capped.

03:38.100 --> 03:44.400
If you misspell the property name or if you provide the name of a non-existent property then those partial

03:44.400 --> 03:46.780
vision will not generate an error.

03:46.800 --> 03:52.200
Instead your command drill will not generate any output for example.

03:52.200 --> 03:57.330
Good service by where strt this EAC around him.

03:57.330 --> 04:04.380
This command produces no output because no service object has a state property that contains the well

04:04.380 --> 04:05.170
you're running.

04:05.310 --> 04:09.500
Actually none of the service objects have stirred up their dough.

04:09.600 --> 04:13.940
This is why the comparison returns FALSE For every object.

04:13.950 --> 04:19.980
Please know that because of the complex parameters that's needed to make the basic syntax functional

04:20.220 --> 04:24.980
the help file for where object is very long and difficult to read.

04:24.990 --> 04:32.840
Consider steepen the initial syntax section and go directly to the description or examples.

04:32.880 --> 04:37.860
If you need help with this command there are some limitations of the basic syntax.

04:37.860 --> 04:41.670
The basic syntax can be used to resolve a single comparison.

04:41.700 --> 04:48.540
You could not for example display a list of services that were stopped and had a start mode of murder

04:48.750 --> 04:51.760
because that would require two comparisons.

04:51.780 --> 04:55.350
The basic syntax cannot be used with complex expressions.

04:55.350 --> 05:02.050
For example the name property of a service object in a string of characters windows partial shell uses

05:02.070 --> 05:10.240
a system that stree an object to contain that string of characters and that system docstring object

05:10.240 --> 05:11.780
has a lens property.

05:11.900 --> 05:19.300
The foreign command will not Rocha's a basic filter and text get service by where named dot lands is

05:19.300 --> 05:20.470
equal to 5.

05:20.470 --> 05:25.930
The intent is to display all services that have a name longer than five characters.

05:25.930 --> 05:31.270
However this command will never produce output as soon as you exceed the capabilities.

05:31.270 --> 05:35.890
So the basic syntax you'll have to move to the advanced filtering syntax.
