WEBVTT

00:00.370 --> 00:05.570
Windows power shell commands can accept input only from one of their parameters.

00:05.580 --> 00:12.360
This creates a statement that is an easy statement to read but how the command works may not all is

00:12.440 --> 00:14.590
obvious when you run a command.

00:14.610 --> 00:22.560
For example get service Robsart sort object property status type select object does property name call

00:22.560 --> 00:23.480
my status.

00:23.550 --> 00:32.370
In that example it seems as if both cert object and select object are an input in some other way.

00:32.430 --> 00:39.840
Let object produced by get service are somehow being picked up out of the pipeline by Sorto object and

00:39.840 --> 00:40.670
so on.

00:40.680 --> 00:47.850
In reality both Sorto object and select object are being given to parameters not the one parameter alert.

00:47.850 --> 00:55.110
You can see the other parameter isn't visible used by Windows or a shell in a process that is known

00:55.110 --> 00:57.700
as pipelined parameter or bind.

00:57.810 --> 01:04.860
Basically when two commands are connected in the pipeline pipeline perimeter bind and has to take the

01:04.950 --> 01:09.750
output of the Thurles command and decide what to do with it.

01:09.750 --> 01:16.740
That process has to select one of the parameters of the second command that is to receive those objects

01:16.860 --> 01:21.110
the shell has two techniques that it uses to make that decision.

01:21.120 --> 01:27.180
The first technique and the one that the shell of is try to use first is called by well.

01:27.330 --> 01:33.360
The second technique is called by Robert a name and it is only used to and by well your fails if you

01:33.360 --> 01:35.180
read the full help for a command.

01:35.190 --> 01:39.570
You can see the pipeline input capability of each parameter.

01:39.570 --> 01:46.890
For example in the help file for saut object you will find the following in the except pipeline input

01:47.020 --> 01:53.610
attribute is true because the input object parameter accepts pipeline input.

01:53.610 --> 01:58.060
Also shown is a list of the techniques the perimeter supports.

01:58.110 --> 02:05.370
In this case it supports only by well your technique by using by well your perimeter can accept complete

02:05.370 --> 02:07.390
objects from the pipeline.

02:07.500 --> 02:14.070
When those objects are of the type that's the parameter except a single command can have more than one

02:14.070 --> 02:17.840
parameter acceptant pipeline input by well.

02:17.970 --> 02:22.030
But each parameter will accept a different kind of object.

02:22.080 --> 02:30.360
For example good service can accept pipeline input by well-you on both its input object and name parameters

02:30.540 --> 02:38.640
those parameters each except a different kind of object input object accepts objects of the type service

02:38.640 --> 02:43.980
controller and name accepts objects of the type Stream.

02:43.980 --> 02:47.740
Let's look at the example SCORM are we in the room.

02:47.810 --> 02:55.640
Why get source bits Andrina RAM are in quotes here to String objects are being piped into service.

02:55.650 --> 03:03.960
This will be attached to the main parameter because that parameter accepts that kind of object by well

03:03.960 --> 03:11.580
you from the pipeline like you to predict in what the shell will do with objects in the pipeline.

03:11.730 --> 03:12.730
Is Novum.

03:12.840 --> 03:16.950
What kind of objects is in the pipeline to do that.

03:16.940 --> 03:24.060
You can pipe the object to get mamber the first line of output will tell you what kind of object the

03:24.060 --> 03:25.630
pipeline can.

03:25.650 --> 03:32.670
For example if you type bits in quotes comma in a room and quotes and pipe it to get member you'll get

03:32.670 --> 03:34.250
the following output.

03:34.290 --> 03:41.100
Here are the pipeline contained objects of the type system Dadds scream windows power shell frequently

03:41.310 --> 03:47.840
abbreviates type names to include only the last portion and this example that would be stream.

03:47.880 --> 03:52.010
Then you examine the food held for the next amount in the pipeline.

03:52.050 --> 04:00.840
In this example you just get service and you would find that most the input object and name parameters

04:01.050 --> 04:09.450
except input from the pipeline by well-you because their pipeline contains objects of that type Stream.

04:09.510 --> 04:17.550
And because the name parameter accepts objects of the types drinn from the pipeline by well-you the

04:17.610 --> 04:25.860
objects in the pipeline are attached to the main parameter Rondo's partial recognizers to generic kind

04:25.860 --> 04:35.640
of object object and B-S object parameters that except these kinds of objects can accept any kind of

04:35.650 --> 04:40.320
object when you perform by well-you pipeline parameter bind.

04:40.470 --> 04:45.450
This shell force looks for the most specific object type possible.

04:45.480 --> 04:53.100
If the pipeline contains a string and two parameter can accept string that parameter will receive the

04:53.190 --> 04:53.810
object.

04:53.880 --> 05:01.910
If there is no match for a specific data type this shell will try to match generic type data type that

05:01.910 --> 05:11.240
behavior is why comments like sort object and select object work those commands each have a parameter

05:11.240 --> 05:19.470
named the input object that accepts objects of that type B the Saab's are from the pipeline by well.

05:19.580 --> 05:23.010
That is why you can pipe and listen to those commands.

05:23.060 --> 05:31.430
Their input object parameter will receive anything from the pipeline because it accepts objects of any

05:31.430 --> 05:32.150
kind.

05:32.150 --> 05:35.400
Now let's review some demonstration examples.

05:35.480 --> 05:40.110
Let's look at this command get service Desch name bits.

05:40.130 --> 05:42.560
Why stop the service.

05:42.560 --> 05:47.540
Let's discover what kind of object the files command produces.

05:47.600 --> 05:55.550
To do that let's Taieb get service by GET member as you can see that name is service controller.

05:55.550 --> 05:58.070
Now let's discover what parameter is.

05:58.220 --> 06:05.210
The second command from this example can accept pipelining input by well you know to do that let's type

06:05.210 --> 06:09.930
help stop service desk show window and turn this help window.

06:09.980 --> 06:17.390
You have to find the input object parameter accepts objects of the type service controller from the

06:17.390 --> 06:19.810
pipeline by using by well.

06:19.910 --> 06:26.870
So now you can determine that the object spread used by the first command the command in the example

06:27.050 --> 06:32.310
will be attached to the input object parameter of the second command.
