00:00:00 - Hi my name is Don Jones.
00:00:02 - And this is the ultimate
class for Windows PowerShell,
00:00:05 - covering every version that
you might have in production.
00:00:08 - This Nugget is your
00:00:10 - And I'll also cover
00:00:12 - about what you'll
need if you want
00:00:13 - to follow along and
do your own lab.
00:00:17 - Now, this series is a little bit
different from many of the CBT
00:00:20 - Nugget series that you
may be familiar with.
00:00:22 - For one, this one is huge.
00:00:24 - I've actually broken
it down into a number
00:00:26 - of different sections.
00:00:27 - And each section has
several different Nuggets
00:00:30 - that contribute to that.
00:00:31 - You can look at the
Nugget names and you'll
00:00:33 - be able to see these
same session titles.
00:00:36 - For example, I
guess, let's start
00:00:37 - with where we are right now,
which is PowerShell Core.
00:00:41 - So this is going to cover
some of the main stuff
00:00:44 - that you need to know to
make PowerShell useful.
00:00:46 - And then we're going to get
into PowerShell Remoting.
00:00:47 - Now that, I think, is
one of the coolest things
00:00:49 - you can do with PowerShell.
00:00:51 - The ability to reach
out from one computer
00:00:54 - and manage multiple other
00:00:57 - in parallel.
00:00:59 - Closely related to that,
we've got Windows Management
00:01:01 - Instrumentation and CIM, the
common Information Model,
00:01:04 - a way of collecting management
information, and in some cases
00:01:07 - making changes to it.
00:01:09 - We'll also talk about
00:01:10 - Getting PowerShell doing
more than one thing for you.
00:01:13 - And then, we'll finally
dive into actual scripting.
00:01:17 - And this is where
00:01:18 - to become a little
bit like a programming
00:01:20 - language I guess you could say.
00:01:22 - And we're going to
00:01:23 - entire processes that way.
00:01:25 - Now, a key part of
that are these things
00:01:27 - called Script commandlets, at
least that's what I call them,
00:01:30 - what some folks call them.
00:01:31 - They're officially called
00:01:34 - They're a great way of
building your scripts
00:01:36 - in a way that makes
them look and smell
00:01:38 - and feel and taste just like
a real PowerShell command.
00:01:42 - Then we'll get into some
advanced scripting techniques,
00:01:44 - take things a
little bit further.
00:01:46 - And this is a
great section, this
00:01:48 - is what I call
PowerShell in the field.
00:01:50 - It's a chance to take all
the things we've done up
00:01:52 - to that point and use them
in some really production
00:01:56 - appropriate ways to accomplish
some real tasks using
00:02:00 - all that stuff.
00:02:02 - Then we're going to
start really ramping
00:02:04 - into some of PowerShell's
more advanced features,
00:02:06 - including workflow and
desired state configuration.
00:02:10 - We're also going to have a
section I call writing scripts
00:02:12 - for other people.
00:02:14 - Now, this is when
you're writing a script,
00:02:16 - but you really want to
create it as a tool.
00:02:19 - In fact, I use the
word tool making
00:02:20 - instead of scripting
because you want
00:02:22 - to write a script that someone
else can consume without really
00:02:26 - knowing much about
what happens inside.
00:02:28 - And then we'll wrap up this
series with a huge section
00:02:32 - on advanced core techniques,
tips, and tricks.
00:02:35 - So we definitely have got
a massive range of things
00:02:38 - to cover.
00:02:39 - Pretty much everything
00:02:41 - can do with Windows
00:02:44 - going to be done in this series.
00:02:46 - Now, one of the things
I'm going to throw
00:02:48 - at you with each
section, and sometimes
00:02:50 - in the middle of sections,
is a hands on lab.
00:02:53 - I'm actually going to give
you written lab instructions
00:02:56 - for a task that I
want you accomplish.
00:02:58 - And then I'll take
an entire Nugget
00:02:59 - and set it aside
to go over how I
00:03:02 - think I would accomplish
that particular task.
00:03:05 - That doesn't mean
what you do is wrong
00:03:07 - if it's different from mine.
00:03:08 - It's just a way of giving you
a variety of perspectives.
00:03:11 - But to do that,
you're going to need
00:03:13 - some kind of lab
environment to work with.
00:03:15 - At a minimum, I recommend
you have a Windows 8
00:03:20 - or later client
computer to work with.
00:03:23 - Now, if you want to kind
of go back and forth
00:03:25 - between the different
versions of PowerShell,
00:03:27 - then you're going to need
multiple different client
00:03:30 - computers work with.
00:03:31 - That's why I've also got a
Windows 7 computer over here
00:03:33 - that I'm going to be
able to play with.
00:03:36 - Now, some of the stuff we're
going to do really, really
00:03:38 - does plan to servers.
00:03:39 - So let me outline my entire
lab environment here.
00:03:42 - I'm starting with the
00:03:44 - And I've got as I said,
a Windows 8 client
00:03:47 - computer, and a Windows
7 client computer.
00:03:49 - I've also got a member server.
00:03:51 - So this domain, LAB.PRI has got
four different computers in it.
00:03:57 - It has a forest trust,
a two way forest
00:03:59 - trust with a completely separate
forest call REMOTE.PRI, which
00:04:03 - simply has a domain
controller in it.
00:04:05 - And there's also
another forest, which
00:04:07 - has no trust with anybody,
it's very untrusting,
00:04:10 - called FOREIGN.PRI, which also
has a domain controller in it.
00:04:15 - Most of this complexity
is here for when
00:04:17 - we start talking about
Windows PowerShell remoting.
00:04:20 - Because going across forests
and to untrusted forests
00:04:24 - is where things get interesting
and complex with remoting.
00:04:27 - So from a day-to-day
00:04:29 - you certainly don't
need all of this.
00:04:31 - You could get by
with a single test
00:04:34 - domain that has a domain
controller and a client
00:04:37 - computer.
00:04:37 - You could get by with
just a client computer,
00:04:39 - but if you really
want to play around,
00:04:42 - have that domain controller too.
00:04:44 - Now, there's a few different
ways you could build this out.
00:04:46 - Obviously, if you've
got a copy Windows 8,
00:04:49 - it's got hyper-v
built right into it.
00:04:51 - So if you've got hardware that's
capable of running hyper-v
00:04:54 - on Windows 8, I'll just spin
up a couple virtual machines.
00:04:57 - In fact, you can go
to Microsoft's website
00:04:59 - and if you do a little
Google search or Bing
00:05:01 - search for VHD
test drive, you're
00:05:05 - going to find some pre-installed
virtual machines that you can
00:05:11 - download and run in hyper-v.
And that'll give you a domain
00:05:14 - controller, it can give
you a client computer.
00:05:16 - And you won't have to
do much to set it up.
00:05:18 - Alternately, if you want to
set everything from scratch,
00:05:21 - you can download the trial
versions, the e valve versions
00:05:24 - of both the client
00:05:27 - and the server operating system.
00:05:29 - I'm not going to show
you how to promote
00:05:30 - a domain controller or anything.
00:05:32 - If you're kind of
coming in here,
00:05:33 - you should already be
at that level of admin.
00:05:35 - You should know how to build
yourself a domain controller
00:05:37 - and know how to get
the OS's installed.
00:05:40 - So it's a couple ways to do it.
00:05:41 - If you live in countries
where it's available,
00:05:43 - there's another
service you might
00:05:44 - look into called Cloud Share.
00:05:50 - They have a trial
period that you can use.
00:05:52 - It's not a very
00:05:54 - You'd have to pay for it
if you want to use it.
00:05:56 - But essentially,
it'll let you build up
00:05:58 - to six virtual
machines in a Cloud.
00:06:01 - And they don't run
them all the time
00:06:03 - and that's one of the reasons
they're fairly inexpensive.
00:06:05 - This isn't like building
something in an Azure or Amazon
00:06:08 - Web Services.
00:06:09 - They're actually going to let
you spin up from templates.
00:06:12 - So they've already got pre
created domain controllers
00:06:14 - and client computers
and all that.
00:06:16 - So you can very, very quickly
get a lab environment up
00:06:18 - and running.
00:06:19 - You access it via a little
web viewer browser thing
00:06:24 - that they give you.
00:06:24 - You can also again in by a
remote desktop of course.
00:06:27 - And that's going to be a
great way to get a lab up
00:06:29 - and running that you can
access from anywhere.
00:06:31 - It does cost a little bit, so
it's something to check in to.
00:06:33 - But I wanted to make sure you
had several different options
00:06:36 - to work with in terms
of getting a lab going.
00:06:38 - And again, you're
going to be able to do
00:06:40 - most of what I'm showing you
with just a client computer.
00:06:44 - You don't need anything
more than that.
00:06:47 - Certainly gets more
00:06:48 - you have more
computers to play with.
00:06:50 - And you'll be able to practice
a wider varieties of things.
00:06:53 - But don't feel that you're
going to be left out if all you
00:06:55 - can get your hands on
is a client computer.
00:06:59 - Our PowerShell to
do list is not going
00:07:01 - to get any shorter just
sitting here yapping.
00:07:03 - But before we go on to
the real meat of this,
00:07:05 - I want to point out the
methodology I'm going to use.
00:07:08 - In every one of the
00:07:10 - I'm going to start with version
two of Windows PowerShell.
00:07:13 - There's a lot of folks who
are using that in production
00:07:15 - and they will probably
be around for a while.
00:07:17 - Now, version two runs on Windows
XP or later on the client OS.
00:07:21 - And on the server side it's
Windows Server 2003 and later.
00:07:25 - Then, toward the
end of each Nugget,
00:07:27 - I'll cover what was
new, or changed.
00:07:29 - And usually it's just new
in version three, which
00:07:32 - is available for
Windows 7 and later,
00:07:34 - and Windows Server
2008 and later.
00:07:36 - And after that, I'll cover
what's new or changed.
00:07:38 - Again, mostly new in version 4,
which is Windows 7 and later,
00:07:42 - and Windows Server
2008 R2 and later.
00:07:46 - That way no matter what version
of PowerShell you're using
00:07:49 - or if you're in a
00:07:50 - you'll be completely clear on
what happens in each version.
00:07:55 - What you can do in
version three that you
00:07:57 - couldn't do in version two.
00:07:58 - And there won't be any
confusion about the version
00:08:00 - back and fourth stuff.
00:08:01 - So I think by laying
it out that way,
00:08:03 - you'll be able to stay
on track, understand
00:08:05 - what's going to work
in your environment,
00:08:06 - and what you might be limited
to if you're using an older
00:08:09 - version of Windows PowerShell.
00:08:12 - OK that's all the preliminaries.
00:08:13 - So let's get started.