WEBVTT

00:06.360 --> 00:12.340
You need to learn the basics and have a point of reference for building your own scripts.

00:12.510 --> 00:19.920
And this lesson will cover more powerful concepts that will provide you with a foundation of knowledge

00:19.920 --> 00:21.140
for you.

00:21.150 --> 00:27.890
And there remain examples in this course if you are already familiar with power.

00:28.080 --> 00:35.870
You may want to use this video as a review or as a reference for a later after you've started writing

00:35.880 --> 00:36.810
scripts.

00:36.900 --> 00:41.830
If you are completely in your power show the concept may be familiar.

00:41.940 --> 00:51.330
If you've worked with Unix common shelves like Unix based shells Rocio also allows you to string multiple

00:51.330 --> 00:56.280
commands together on one line using a technique called pipelining.

00:56.340 --> 01:01.920
This means that the output of one command becomes the input for another.

01:01.920 --> 01:07.850
First off let's open Power Shell Rona's search for power shell on your computer.

01:07.950 --> 01:17.370
You probably have several different options like Power Shell Power Shell eyes the Power Shell X 86 the

01:17.460 --> 01:24.870
IAC or integrated scripting environment as I've mentioned already is a handy tool which allows you to

01:24.870 --> 01:31.860
write scripts on the fly and also has a conventional low carb for all the power shell commands.

01:31.860 --> 01:38.960
Right now this is more than when the int x 86 exist for backwards compatibility.

01:39.000 --> 01:47.850
We want x 64 bit for our use for general use one just called Windows power shell.

01:47.850 --> 01:53.810
You may want to pin it to your test bar right click it to give this option.

01:53.910 --> 01:56.450
When you open it it will look like this.

01:56.460 --> 02:05.070
If you don't like the white on blue right click the top bar select Properties and go to colors to change

02:05.070 --> 02:05.880
things.

02:05.880 --> 02:11.260
You may have to close and threw open Power Shell to get it to display correctly.

02:11.400 --> 02:19.260
When we are ready we can navigate to our system and I seen about power Challice you always know where

02:19.260 --> 02:23.040
you are because it tells you that in the prompt.

02:23.070 --> 02:30.690
In my case it's Langley's but you should say something similar but with your username in case you don't

02:30.960 --> 02:35.340
just type as cell space field character.

02:35.460 --> 02:37.310
Make sure to include the space.

02:37.310 --> 02:44.820
This will bring you to your home directory directory is just another word for folder and power shell

02:45.000 --> 02:52.250
considers your user folder to be your home and turn SL space.

02:52.280 --> 03:01.040
Tilt is just like opening a folder called to users and from there using your graphical user interface.

03:01.050 --> 03:08.640
So let's start by learning how to move around between directories and view their contents to view directory

03:08.640 --> 03:09.570
contents.

03:09.600 --> 03:13.970
You could use get the child item command layout.

03:13.980 --> 03:16.560
There are several aliases for it.

03:16.570 --> 03:22.350
Also you could type GC LS or D.

03:22.530 --> 03:32.040
All those are aliases for the get the child title command left our first command is Girl Child Titan

03:32.190 --> 03:35.900
So go ahead and type it to him and he turned to her.

03:35.970 --> 03:39.690
You see a list of everything in your current directory.

03:39.810 --> 03:42.240
In my case that looks like this.

03:42.330 --> 03:45.010
It could be different on your screen.

03:45.130 --> 03:52.740
Notice that instead of this long command to get to this child diatom you could just enter jucy II.

03:52.950 --> 03:59.370
It's an abbreviation for it or ls the command so will the command SOORLEY will belong in.

03:59.400 --> 04:03.570
Are all of the form verb dush now.

04:03.700 --> 04:11.190
These are called command lengths and to their form is supposed to make it easier to remember what they

04:11.190 --> 04:14.410
do and predict similar command last.

04:14.520 --> 04:16.680
Because command lets a rather long.

04:16.830 --> 04:23.840
Most of them come with slicker aliases as I've mentioned that you can use instead.

04:23.840 --> 04:25.080
I know fields present.

04:25.100 --> 04:33.510
C'mon let's me their names but Olva's subsequently use standard aliases because they are much faster

04:33.510 --> 04:34.640
to work with.

04:34.650 --> 04:41.160
It is important to note that many criminals have multiple aliases for instance.

04:41.160 --> 04:50.050
These can get child to item either GC ID or or less all of them do exactly the same theme.

04:50.100 --> 04:59.550
While it is unsurprising that GCI is short for get child Titan you may be wondering where dir or ls

04:59.550 --> 05:08.600
come from voer shell is relatively new and its designers anticipated many people who would use it we

05:08.660 --> 05:13.590
already have experience with some existing command line interface.

05:13.610 --> 05:21.080
Specifically are there is Microsoft command line interface called common prompt or is Linux command

05:21.080 --> 05:29.810
line interface like bash which is now also standard on all six last medicament let's have an alias that

05:29.810 --> 05:33.880
is standard command in one of these two systems.

05:33.950 --> 05:42.280
And often for both in the present example dir comes from command prompt and LS comes from Bash.

05:42.340 --> 05:51.240
I'll use PowerShares style aliases in this demonstration but I'll try to mention all the common Eliseus

05:51.260 --> 05:55.910
particular those familiar for best use so Linux users.

05:55.940 --> 06:04.620
So go ahead and try using GCI dir or ls command and see the contents of your directory.

06:04.730 --> 06:12.450
Now when we do that we can move between directories with set the location Come on left or as well.

06:12.470 --> 06:13.990
Abbreviation for it.

06:14.030 --> 06:16.220
Or C D command.

06:16.250 --> 06:23.560
It's good for Command Prompt previous command prompt Windows system and Linux system.

06:23.570 --> 06:32.460
Let's type our cell and some folder which you can see in the output of your previous command and it

06:32.500 --> 06:40.550
will change your location from your current location to the folder you've specified.

06:40.550 --> 06:48.550
We can move back to our previous location again by type in our cell and two dots.

06:48.620 --> 06:52.630
And of course the space between a cell command and two dots.

06:52.640 --> 06:59.460
Now try and navigate back to the folder you've been before and to some other folder.

06:59.530 --> 07:00.490
Makes sense.

07:00.490 --> 07:08.090
The command and cell command if you want to navigate to like Allsop you could try Taipan as well cell

07:08.180 --> 07:14.930
space two dots backslash two dots instead of backslash you could also type slash.

07:14.960 --> 07:24.470
So power shell is not case sensitive and it doesn't care about the slashes so it could be a backslash

07:24.470 --> 07:25.730
or just slash.

07:25.730 --> 07:33.600
Now we can try create a new directory with Qadeer command in any folder you like.

07:33.710 --> 07:41.710
If you want to get back to your home directory fast you could type again and sell space to build and

07:41.720 --> 07:43.990
it'll get you to your home directory.

07:44.120 --> 07:53.300
And here we can make a new directory that's type M-K dear and call the directory like Pyrus or whatever

07:53.540 --> 07:56.950
name you like move into your new directory.

07:57.020 --> 08:04.960
Use an S L command top by Taipan cell and whatever your title to your directory.

08:04.970 --> 08:06.650
In my case it's best.

08:06.710 --> 08:11.610
Now let's type juicy and you'll see that there is nothing here.

08:11.750 --> 08:15.790
That's because we've just created this directory and it's empty.

08:15.830 --> 08:20.650
We could again create a subdirectory here with M-K dear.

08:20.660 --> 08:22.050
So let's create it.

08:22.070 --> 08:27.930
Type in M-K dir and give it some long name in quotes like.

08:28.160 --> 08:30.290
This is a very long name.

08:30.290 --> 08:36.380
Know that if you give some long name to this directory you should put it in quotes.

08:36.380 --> 08:43.430
Now enter GCI and hit enter again and you'll see your new directory.

08:43.430 --> 08:47.180
Suppose we want to move into this directory.

08:47.210 --> 08:49.870
You'd have to type as well.

08:49.980 --> 08:59.150
And this long name not only will this take a while to type but if we have got one letter wrong Power

08:59.150 --> 09:02.330
Shell won't be able to find our director.

09:02.330 --> 09:12.230
Instead try just type in SL D and then hit the tab key and partial completes the name of the directory

09:12.230 --> 09:19.940
for you including the quotes Yulian step 4 or to completion will save you a lot of time.

09:19.970 --> 09:25.070
You'll notice that when power schelde completed the name it also goes through.

09:25.190 --> 09:33.800
Ian Dalt backslash of the beginning of the directory name that dot is just shorthand for the current

09:33.800 --> 09:36.110
directory when you type commands.

09:36.110 --> 09:36.840
Power Shell.

09:36.860 --> 09:41.690
All of this assumes there is a dot backslash at the beginning.

09:41.690 --> 09:46.630
In other words that you are referring to Samson in the current directory.

09:46.730 --> 09:50.330
So you don't have to type this part all the time

09:57.780 --> 10:04.560
if you want to find some specific command but don't know if this command exists at all or you could

10:04.560 --> 10:09.340
use get command command left which is very important.

10:09.510 --> 10:18.510
And you can try looking for a command to this command left so get command itself will output all the

10:18.510 --> 10:26.160
commands which are available for you if you need some command which will be looking for a noun like

10:26.310 --> 10:33.390
proses you could use get command Desch noun and specify the noun you are looking for.

10:33.480 --> 10:42.840
For example Brosius if you are looking for a command which contains a verb like start stop etc. You

10:42.840 --> 10:50.360
could try and get command to destroy roar and specify the word you are looking for for example star.

10:50.490 --> 10:58.800
If you're looking for South Pacific Command which is part of some module which you know like Power Shell

10:58.800 --> 11:07.320
get or active directory model or some other module you could try use and get this module power shell

11:07.320 --> 11:12.290
get that will find all the commands in that specific module.

11:12.450 --> 11:19.170
And of course your extend standard is specifying that you are looking for vore and that more do like

11:19.220 --> 11:25.760
get commanders more power shell get Andrea looking for vore find in that module.

11:25.860 --> 11:29.610
Of course you can all of us look for help on that command.

11:29.700 --> 11:39.240
Yes get does help come and let and specify the command you'll need help on for example find does Maggio

11:39.510 --> 11:40.670
get health care.

11:40.780 --> 11:48.730
Course several options like get help does online get help this fool etc..

11:48.870 --> 11:58.470
You could try Taipan get help find us Mondial that's fool or DERSE online or dush examples that will

11:58.470 --> 12:03.470
show you only examples of usage of this command.

12:10.640 --> 12:18.260
In addition to get and come and get help for commands you can use get help to view supplemental help

12:18.260 --> 12:26.630
files that explained General Power Shell concepts that focused primarily on scriptum to display the

12:26.630 --> 12:36.080
help file for a particular concept type get help about underscore followed by the concept name for example

12:36.340 --> 12:39.660
to use the help for the core power shell commands.

12:39.670 --> 12:40.850
Type the following.

12:40.940 --> 12:50.690
Get help about underscore or underscore commands or to view the entire list of conceptual help files

12:51.020 --> 12:56.510
using the form and come and get help about underscore asterisk.

12:56.570 --> 13:05.270
Now some words about command aliases through all discourse and the examples used when refer to a command

13:05.300 --> 13:08.010
trellises or common Gletty aliases.

13:08.060 --> 13:17.180
For example the short name of the fool command let the LSS can be very handy when trying to type long

13:17.180 --> 13:24.430
scripts where you might want to optimize and keep them as small as and as short as possible.

13:24.440 --> 13:27.970
For instance we have the command let a rare object.

13:28.130 --> 13:30.370
We have two aliases for it.

13:30.410 --> 13:36.230
You can use a question mark for it or just wear it.

13:36.230 --> 13:39.410
Another example is for each object.

13:39.410 --> 13:42.440
There are two aliases for it as well.

13:42.500 --> 13:48.800
You can use bosomed character or just one vote for each.

13:48.800 --> 13:50.940
Another example is select objects.

13:51.080 --> 13:59.590
You can use Elyas just select for release command left and so on to get a list of all current.

13:59.600 --> 14:02.360
This is just I've get ls.

14:02.560 --> 14:05.050
Now some words about pipeline's.

14:05.090 --> 14:12.460
The single most important concept in both a shell is the use of its flexible object based by applying

14:12.770 --> 14:15.760
the concept of pipelines that is similar.

14:15.800 --> 14:20.440
Is that your Sandom the output from one command to another.

14:20.660 --> 14:27.710
But instead of parsing plaintext power shell works with objects and we can accomplish some very complex

14:27.710 --> 14:30.700
tasks in just a single line of code.

14:30.800 --> 14:39.310
As a quick example you can get all the services running on the server and pipe it to stop service command

14:39.320 --> 14:44.870
left with just one line and you will find all the services and stop them.

14:44.870 --> 14:49.370
Of course don't try to perform this on production server.

14:49.520 --> 14:55.550
Now let's take a look at using a variable Zantop jokes which you will be using very often.

14:55.610 --> 15:03.800
The variables are supposed to save temporal data to a new object so you can workers it later for example

15:03.800 --> 15:09.560
to create a variable that stores an instance of the test user mailbox.

15:09.620 --> 15:16.310
You can type the following command door character mailbox equals to get mailbox.

15:16.400 --> 15:23.630
Test User as you can see to create a variable or instance of an object you prefix the variable name

15:23.630 --> 15:27.680
with the dollar sign to the right of the variable name.

15:27.710 --> 15:36.650
You have to use that equals assignment operator followed by the ratio of or the object that should be

15:36.650 --> 15:38.630
assigned to the variable.

15:38.630 --> 15:45.800
Keep in mind that the variables are only available during your current shell session and will be destroyed

15:45.800 --> 15:47.630
when you close the shell.

15:47.720 --> 15:56.250
And remember that you can work with variables in the same frame as you work with any object containing

15:56.290 --> 15:57.770
named its properties.

15:57.770 --> 15:59.240
My thoughts are also on.
