WEBVTT

00:00.000 --> 00:03.300
>> Hello everyone. I'm
instructor Gerri Roberts,

00:03.300 --> 00:05.325
and this is
PowerShell scripting.

00:05.325 --> 00:08.115
In this video, we're
going to talk about

00:08.115 --> 00:09.510
which PowerShell tools you

00:09.510 --> 00:11.535
can use to work with PowerShell,

00:11.535 --> 00:13.965
PowerShell and the command line,

00:13.965 --> 00:16.530
customizing the interface and

00:16.530 --> 00:19.660
some tools for
PowerShell scripting.

00:19.940 --> 00:23.100
First, let's talk about
PowerShell tools.

00:23.100 --> 00:24.929
In order to use PowerShell,

00:24.929 --> 00:27.015
you have to use
one of the tools.

00:27.015 --> 00:28.950
There are a couple of
main tools that are

00:28.950 --> 00:31.485
loaded into Windows instances.

00:31.485 --> 00:33.210
The first one is console.

00:33.210 --> 00:36.480
There's x64 and x86 version,

00:36.480 --> 00:39.490
so there's a 32-bit
and 64-bit version.

00:39.490 --> 00:41.945
When opening them,

00:41.945 --> 00:46.280
x64-bit is usually listed
as just PowerShell,

00:46.280 --> 00:51.860
and x86 is usually listed
as PowerShell x86.

00:51.860 --> 00:56.330
This is good for basic
PowerShell usage.

00:56.330 --> 00:59.365
You also have PowerShell ISE.

00:59.365 --> 01:02.300
ISE stands for, Integrated
Scripting Environment,

01:02.300 --> 01:04.175
and this is great
for writing scripts,

01:04.175 --> 01:06.810
saving scripts,
and testing them.

01:07.310 --> 01:10.430
To open the tools,

01:10.430 --> 01:12.215
there are a couple of methods.

01:12.215 --> 01:15.650
Easiest way of locating
and opening them,

01:15.650 --> 01:17.645
is to use the Windows
Search feature

01:17.645 --> 01:19.880
as you can see
picture to the right.

01:19.880 --> 01:22.100
Typically, when you
type in PowerShell,

01:22.100 --> 01:24.560
you'll get a list that
looks similar to this,

01:24.560 --> 01:26.450
and you'll see that you have

01:26.450 --> 01:33.470
the ISE x86 and you also
have the regular one listed.

01:33.470 --> 01:37.460
Best practice is to run
in administrative mode.

01:37.460 --> 01:40.250
When you go to open
up PowerShell ISE,

01:40.250 --> 01:44.085
you can either right-click
or go administrator mode,

01:44.085 --> 01:46.215
and that's the same
for the consoles.

01:46.215 --> 01:47.960
Anytime you go and
try to open any of

01:47.960 --> 01:49.730
them, right-click
administrative mode,

01:49.730 --> 01:52.580
or if you noticed in Windows 10,

01:52.580 --> 01:55.220
you also get this
little option here and

01:55.220 --> 01:58.400
the apps pane that says
run as an administrator.

01:58.400 --> 02:00.860
For server, there's actually

02:00.860 --> 02:03.680
a special place you can
find PowerShell tools.

02:03.680 --> 02:07.355
If you go to Server Manager
and you go to the Tools menu,

02:07.355 --> 02:08.960
you can find them in there.

02:08.960 --> 02:11.060
Now you can still search
for them just like

02:11.060 --> 02:13.235
you can in the client
version of Windows,

02:13.235 --> 02:17.160
it just seems a lot quicker
to go tools and PowerShell.

02:17.750 --> 02:20.390
Now, if you're not using

02:20.390 --> 02:22.820
a tool and you want to use
the command line instead,

02:22.820 --> 02:24.500
you can actually do that.

02:24.500 --> 02:26.345
It's very simple.

02:26.345 --> 02:29.765
Opening and closing PowerShell
in the command line.

02:29.765 --> 02:32.540
For opening, you type

02:32.540 --> 02:35.045
in PowerShell and as
you can see here,

02:35.045 --> 02:36.290
you'll get a prompt that says

02:36.290 --> 02:38.910
PowerShell copyright
information,

02:38.910 --> 02:40.385
and then you will get

02:40.385 --> 02:43.190
your listing here
with PS in the front,

02:43.190 --> 02:46.270
instead of just your
regular prompt.

02:46.270 --> 02:51.525
Closing PowerShell,
very simple as well,

02:51.525 --> 02:53.630
just type in exit
and you will go back

02:53.630 --> 02:56.850
to a normal command line prompt.

02:58.160 --> 03:01.340
The other thing you could do is

03:01.340 --> 03:04.070
you can customize the
interface for PowerShell.

03:04.070 --> 03:07.705
Now, when you open
up PowerShell,

03:07.705 --> 03:09.810
you'll notice that is very

03:09.810 --> 03:13.455
basic and the command prompt
it's still white on black,

03:13.455 --> 03:16.890
in PowerShell, it's
white on blue.

03:16.890 --> 03:19.640
You'll want to change
that in some cases so

03:19.640 --> 03:22.045
it's easier for you
to read or look at.

03:22.045 --> 03:25.760
To change it in the command
line prompt is simple,

03:25.760 --> 03:28.685
just right-click the title
bar, choose Properties,

03:28.685 --> 03:32.030
you'll see a little menu comes
up and then it pops up to

03:32.030 --> 03:33.800
this nice little box where

03:33.800 --> 03:35.750
you can go and change a
couple of different things.

03:35.750 --> 03:38.810
If you go to the font
section right here,

03:38.810 --> 03:42.890
you'll see that you
can change font size,

03:42.890 --> 03:44.620
type, all that good stuff.

03:44.620 --> 03:46.250
If you want to
change the colors so

03:46.250 --> 03:47.975
it's a little bit
easier to read,

03:47.975 --> 03:51.695
you can go to the colors
tab and change those items.

03:51.695 --> 03:53.060
One thing you'll
want to notice in

03:53.060 --> 03:54.500
the colors tab is that you have

03:54.500 --> 03:58.425
text for your screen
and for pop-ups.

03:58.425 --> 04:01.610
You can change the
background and the text on

04:01.610 --> 04:02.960
the normal screen as well as

04:02.960 --> 04:07.020
any pop-ups that might come
up as a result of a command.

04:07.870 --> 04:11.810
In console, very similar to

04:11.810 --> 04:13.370
the command line
prompt on how you're

04:13.370 --> 04:15.440
going to be able to
make those changes,

04:15.440 --> 04:17.165
just right-click at the top,

04:17.165 --> 04:18.950
go to properties,

04:18.950 --> 04:22.850
and you'll see that you get
a similar box with fonts,

04:22.850 --> 04:25.265
colors, and all that good
stuff that you can do.

04:25.265 --> 04:28.460
Again in here, font
changes font size, type,

04:28.460 --> 04:30.200
all that good stuff, and colors

04:30.200 --> 04:32.045
will change the console colors,

04:32.045 --> 04:33.890
you have foreground
and background

04:33.890 --> 04:35.870
just as you do in
the command line,

04:35.870 --> 04:39.990
as well as pop-up colors like
you do in the command line.

04:40.780 --> 04:43.625
Now, big difference

04:43.625 --> 04:46.625
with ISE or Integrated
Script Environment,

04:46.625 --> 04:49.325
there are a lot more
options for customization.

04:49.325 --> 04:51.380
You can do font, color and size.

04:51.380 --> 04:53.195
If you go to tools and options,

04:53.195 --> 04:55.280
you can change that in there.

04:55.280 --> 04:59.660
You'll see it's under
colors and fonts.

04:59.660 --> 05:01.400
There's also some
other settings in

05:01.400 --> 05:04.085
general settings where
you can change items,

05:04.085 --> 05:06.920
like whether or not
IntelliSense is turned on,

05:06.920 --> 05:08.060
whether or not you can view

05:08.060 --> 05:09.910
line numbers when
you're typing it out,

05:09.910 --> 05:11.375
and all that good stuff.

05:11.375 --> 05:14.345
Another thing in here that
you don't get with others is

05:14.345 --> 05:16.820
a Restore Defaults
where you can go

05:16.820 --> 05:19.500
back to PowerShell ISE defaults.

05:19.500 --> 05:22.680
This is something you can't
really do in the console.

05:23.140 --> 05:27.110
You can also change

05:27.110 --> 05:30.545
how the window is organized
and what you want to show.

05:30.545 --> 05:32.120
On console, on command line,

05:32.120 --> 05:34.700
you pretty much just have
a box and that's it.

05:34.700 --> 05:36.500
In ISE, you have a couple of

05:36.500 --> 05:38.120
different boxes with
different things

05:38.120 --> 05:39.590
that you can move around.

05:39.590 --> 05:41.810
If you want to add
things like say,

05:41.810 --> 05:44.855
the script pane so you can
write out your scripts,

05:44.855 --> 05:46.940
you can go to View and

05:46.940 --> 05:49.265
then choose the item
you want to view.

05:49.265 --> 05:51.710
Now the script pane can be

05:51.710 --> 05:53.810
viewed on the right
or on the top,

05:53.810 --> 05:56.180
so that is something
to remember so you

05:56.180 --> 05:57.560
can move that
around a little bit

05:57.560 --> 05:59.225
to make it easier to read.

05:59.225 --> 06:01.250
You also have a command

06:01.250 --> 06:04.475
add-on that you can add
to the right there.

06:04.475 --> 06:07.100
It's an add-on that
allows you to search for

06:07.100 --> 06:08.360
commands which is super

06:08.360 --> 06:10.280
useful if you can't
remember a whole command,

06:10.280 --> 06:11.720
but you remember part
of it, you could start

06:11.720 --> 06:13.625
typing it and all come up with

06:13.625 --> 06:18.180
a list of similar items
to what you're typing.

06:20.060 --> 06:24.135
Some scripting tools
that are available.

06:24.135 --> 06:27.780
Scripting you can do
with PowerShell ISE.

06:27.780 --> 06:30.055
There are a lot of
people that do that,

06:30.055 --> 06:33.090
and it's very useful, very easy.

06:33.090 --> 06:35.015
You even have a little options

06:35.015 --> 06:37.120
for color-coding and
stuff like that.

06:37.120 --> 06:40.085
You can even write your
scripts in Notepad

06:40.085 --> 06:43.835
and just write them out and
save them as a.PS1 file.

06:43.835 --> 06:49.025
You can also use a
tool called Notepad++.

06:49.025 --> 06:51.725
Notepad++ allows you to

06:51.725 --> 06:54.980
work like you're in
a PowerShell ISE,

06:54.980 --> 06:56.540
your Visual Studio
environment where you

06:56.540 --> 06:58.805
can color-code all
your commands.

06:58.805 --> 07:00.590
You also have Visual Studio,

07:00.590 --> 07:03.410
you can do PowerShell
scripting in Visual Studio and

07:03.410 --> 07:07.260
save it as a.PS1 and run
it as a PowerShell script.

07:07.520 --> 07:10.620
Our post-assessment time here.

07:10.620 --> 07:11.960
If you wanted to use

07:11.960 --> 07:14.000
a PowerShell tool that
was good for scripting,

07:14.000 --> 07:16.460
which tool would you use?

07:16.460 --> 07:18.670
Would you use the
command prompt?

07:18.670 --> 07:21.165
Would you use PowerShell x86?

07:21.165 --> 07:26.795
Would you use PowerShell
ISE or PowerShell x64?

07:26.795 --> 07:31.590
Now you can pause,
if you'd like.

07:33.020 --> 07:36.930
The answer is C, PowerShell ISE.

07:36.930 --> 07:40.640
PowerShell ISE remember is
integrated script environment,

07:40.640 --> 07:43.620
so it's designed for
usage with scripts.

