WEBVTT

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

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

00:05.220 --> 00:06.840
In this video, we're going to

00:06.840 --> 00:08.880
talk about what PowerShell is,

00:08.880 --> 00:11.055
a brief history of PowerShell

00:11.055 --> 00:13.950
and how PowerShell
is actually used.

00:13.950 --> 00:16.485
What exactly is PowerShell?

00:16.485 --> 00:19.920
PowerShell is a command line
shell and scripting tool.

00:19.920 --> 00:23.280
More specifically, it
shows a user interface for

00:23.280 --> 00:25.440
an operating system
that could be

00:25.440 --> 00:29.120
a command line or what
most people are used to,

00:29.120 --> 00:32.310
a GUI based Shell where
you can click around it,

00:32.310 --> 00:34.620
and interact with the interface.

00:34.620 --> 00:37.920
Now, PowerShell is
Command Line-based.

00:37.920 --> 00:40.485
You'll be doing a lot of typing.

00:40.485 --> 00:42.800
PowerShell allows you to perform

00:42.800 --> 00:44.795
tasks by using commands,

00:44.795 --> 00:47.600
for example, adding a user to

00:47.600 --> 00:51.835
Active Directory using
the New-ADUser command.

00:51.835 --> 00:55.759
It also allows you to create
scripts to automate tasks,

00:55.759 --> 00:57.620
such as deploying configuration,

00:57.620 --> 01:00.560
some multiple machines
or Virtual Machines.

01:00.560 --> 01:03.710
Here you can see what
PowerShell looks like.

01:03.710 --> 01:05.240
Now, in this picture,

01:05.240 --> 01:07.280
I have modified the text color.

01:07.280 --> 01:08.960
But for the most part,

01:08.960 --> 01:11.075
PowerShell is going
to look like this,

01:11.075 --> 01:14.030
where you just have a
bunch of lines of text.

01:14.560 --> 01:17.885
Brief history of PowerShell.

01:17.885 --> 01:21.170
Now, originally,
Microsoft used either

01:21.170 --> 01:25.685
Command.exe or CMD.exe first
command line interface.

01:25.685 --> 01:28.505
Some of you may remember

01:28.505 --> 01:30.530
older interfaces that had

01:30.530 --> 01:32.390
to do with DAS and
things like that.

01:32.390 --> 01:36.695
That's what the Command.exe
and CMD.exe did.

01:36.695 --> 01:38.450
Unfortunately,

01:38.450 --> 01:41.320
these are very limited
in what they can do.

01:41.320 --> 01:45.470
Microsoft try their hand at
fixing this by using VB or

01:45.470 --> 01:47.060
Visual Basic Script to complete

01:47.060 --> 01:50.980
tasks that CMD command
line just could not do.

01:50.980 --> 01:53.465
This took a lot of code.

01:53.465 --> 01:56.685
I mean, a lot, very many lines.

01:56.685 --> 01:58.400
They worked on making something

01:58.400 --> 01:59.840
more efficient and started

01:59.840 --> 02:04.745
Project Monad back
in about 2002.

02:04.745 --> 02:08.780
But it wasn't until 2006
when PowerShell 1.0

02:08.780 --> 02:11.120
>> was released that
the world got to

02:11.120 --> 02:12.819
>> actually see PowerShell.

02:12.819 --> 02:14.790
>> When PowerShell
was released it

02:14.790 --> 02:17.040
was released for Server 2003,

02:17.040 --> 02:21.705
Server 2008, XP Service
Pack 2, and Vista.

02:21.705 --> 02:24.780
We are now on PowerShell 5.1 and

02:24.780 --> 02:29.200
PowerShell Core 6.0 and 6.1.

02:30.350 --> 02:33.490
Brief history of versioning.

02:33.490 --> 02:36.770
PowerShell 1 came out in 2006

02:36.770 --> 02:39.995
and again with Server
2003 and 2008,

02:39.995 --> 02:43.790
as well as Windows
Versions for XP and Vista.

02:43.790 --> 02:47.610
In 2009, 2.0 came out

02:47.610 --> 02:49.460
>> and we were able to use that

02:49.460 --> 02:52.490
>> on 2008 R2 and Windows 7.

02:52.490 --> 02:55.460
About three years
later we had 3.0,

02:55.460 --> 02:58.955
which gave us Server
2012, and Windows 8.

02:58.955 --> 03:02.015
Another year later in 2013,

03:02.015 --> 03:03.500
we had 4.0,

03:03.500 --> 03:08.345
which gave us Server 2012
R2, and Windows 8.1.

03:08.345 --> 03:11.870
2014, 5.0 came out

03:11.870 --> 03:14.589
>> and allowed us to
work with Windows 10.

03:14.589 --> 03:17.580
>> Now, more recently,

03:17.580 --> 03:21.345
2017 5.1 came out

03:21.345 --> 03:23.360
and this allowed us to work with

03:23.360 --> 03:25.595
Windows 10 Anniversary Update,

03:25.595 --> 03:28.610
our Server 2016, and

03:28.610 --> 03:32.610
other new iterations
of Microsoft products.

03:32.800 --> 03:35.750
Now, you might have heard
me earlier talk about

03:35.750 --> 03:38.540
PowerShell and PowerShell
Core Versions.

03:38.540 --> 03:40.910
PowerShell Core is actually

03:40.910 --> 03:43.264
the newer iteration
of PowerShell,

03:43.264 --> 03:45.740
is supposed to work
on more systems and

03:45.740 --> 03:48.230
just Microsoft based systems.

03:48.230 --> 03:50.000
You can run it on Windows,

03:50.000 --> 03:52.405
Linux, and Mac systems.

03:52.405 --> 03:55.190
Future development
is focusing on

03:55.190 --> 03:57.470
more Linux distributions such as

03:57.470 --> 04:00.370
IoT operating systems
like Raspberry Pi.

04:00.370 --> 04:04.145
Currently, PowerShell Core 6.1

04:04.145 --> 04:06.440
supports ARM32 devices with

04:06.440 --> 04:08.890
support for more in the future.

04:08.890 --> 04:12.320
Going forward, Microsoft
plans on eventually

04:12.320 --> 04:13.970
replacing all instances of

04:13.970 --> 04:16.070
PowerShell with PowerShell Core.

04:16.070 --> 04:20.090
However, that isn't something
that is 100 percent,

04:20.090 --> 04:21.500
so there is something
you will need to

04:21.500 --> 04:24.230
pay attention to
to see if they do.

04:25.120 --> 04:28.310
Now, why does versioning matter?

04:28.310 --> 04:31.085
Well, there's an
issue of versioning.

04:31.085 --> 04:33.364
Each version of
PowerShell supports

04:33.364 --> 04:36.905
different commands and
different groups of features.

04:36.905 --> 04:38.660
You might need to choose

04:38.660 --> 04:40.490
something different
for what you need to

04:40.490 --> 04:41.570
accomplish than what is

04:41.570 --> 04:44.300
currently with your
operating system.

04:44.300 --> 04:47.090
To do that, you can
get other versions of

04:47.090 --> 04:51.254
PowerShell at Microsoft on
their PowerShell site at

04:51.254 --> 05:01.829
>>
https://docs.microsoft.com/en-us/powershell.

05:01.829 --> 05:04.070
>> Now if you're not
in United States,

05:04.070 --> 05:08.690
you can go to your Microsoft
site for your country,

05:08.690 --> 05:10.100
lookup PowerShell, and it

05:10.100 --> 05:12.450
should be one of
the first results.

05:12.450 --> 05:17.200
PowerShell Core is actually
available on GitHub.

05:17.200 --> 05:19.720
So if you need core,

05:19.720 --> 05:22.205
instead of going to
the Microsoft site,

05:22.205 --> 05:24.380
you can get it on GitHub.

05:24.380 --> 05:27.950
On GitHub you can search for
PowerShell or you can make

05:27.950 --> 05:33.790
your way to
github.com/powershell/powershell.

05:33.790 --> 05:37.970
Over here you can see what
that repository looks like.

05:37.970 --> 05:40.265
There are actually
quite a few files

05:40.265 --> 05:42.650
in here, including
documentation.

05:42.650 --> 05:45.290
It's not just the binaries and

05:45.290 --> 05:48.510
the things that you need
to get PowerShell working.

05:48.920 --> 05:52.230
So what is PowerShell use for?

05:52.230 --> 05:54.815
Earlier, we talked a
little bit about that,

05:54.815 --> 05:56.585
but let's delve a
little bit further.

05:56.585 --> 06:01.900
One of the biggest uses of
PowerShell is automation.

06:01.900 --> 06:04.730
When we're working
on our servers,

06:04.730 --> 06:07.220
there are a lot of
tasks that we need

06:07.220 --> 06:10.450
to do on a regular basis.

06:10.450 --> 06:13.190
Now doing those tasks

06:13.190 --> 06:18.110
manually takes up a lot
of time and that could

06:18.110 --> 06:21.260
be things like pushing
configuration changes to

06:21.260 --> 06:26.325
multiple computers or
updating accounts.

06:26.325 --> 06:27.975
Those kind of things,

06:27.975 --> 06:30.530
if we do them individually,
just would take forever.

06:30.530 --> 06:33.290
We can use PowerShell
to create a script

06:33.290 --> 06:35.780
>> that will run
on a regular basis

06:35.780 --> 06:38.260
>> to automate what
we're trying to do.

06:38.260 --> 06:41.585
PowerShell is also used for

06:41.585 --> 06:45.005
creating other types of scripts
such as log on scripts.

06:45.005 --> 06:47.885
Log on scripts can
do things for us,

06:47.885 --> 06:50.615
like set the desktop
on a computer,

06:50.615 --> 06:54.395
set permissions on the
computer and other things.

06:54.395 --> 06:56.720
Client and server management,

06:56.720 --> 06:58.250
remote management tasks are

06:58.250 --> 07:00.005
one of the biggest things here.

07:00.005 --> 07:02.450
We can remotely
manage client and

07:02.450 --> 07:05.090
server machines
using PowerShell,

07:05.090 --> 07:08.680
using whim or CMI.

07:08.680 --> 07:11.870
We can also use PowerShell
for information gathering

07:11.870 --> 07:14.210
>> such as CPU and
system information.

07:14.210 --> 07:17.750
>> So if we need to go
and find a bunch of

07:17.750 --> 07:22.865
information about particular
systems in our network,

07:22.865 --> 07:25.550
we can use PowerShell to

07:25.550 --> 07:28.580
deploy something to grab
that information for us.

07:28.580 --> 07:30.740
PowerShell can also be used for

07:30.740 --> 07:33.230
computer documentation
such as logs,

07:33.230 --> 07:35.570
more specifically,
like event logs,

07:35.570 --> 07:38.700
security logs, and
other Windows logs.

07:39.620 --> 07:42.340
Time for a test.

07:42.340 --> 07:44.480
If you wanted to use PowerShell

07:44.480 --> 07:46.520
on a non-Windows
operating system,

07:46.520 --> 07:49.030
which version would you use?

07:49.030 --> 07:52.455
Would you use PowerShell 3.0,

07:52.455 --> 07:56.160
would you use
PowerShell Core 6.0,

07:56.160 --> 08:00.510
would you use PowerShell 5.1 or

08:00.510 --> 08:03.329
>> would you use PowerShell 4.0?

08:03.329 --> 08:05.405
>> Now you can pause this video,

08:05.405 --> 08:07.250
but I'll give you
a second to figure

08:07.250 --> 08:10.170
out the answer and then
I'll give you the answer.

08:15.920 --> 08:20.220
The answer, PowerShell Core 6.0.

08:20.220 --> 08:23.030
Now guys, remember,
PowerShell Core is

08:23.030 --> 08:24.710
the version that is
used for Windows

08:24.710 --> 08:27.450
and non- Windows systems.

