►
Description
PowerShell Saturday is a training event for all things PowerShell. The event was held in Raleigh, North Carolina and hosted by Research Triangle PowerShell User Group.
David Stein is going to teach you everything you needed to know about modules, a way to import code into PowerShell that gives you more functionality quickly.
The files for David's slides and code can be found on our github page:
https://github.com/rtpsug/PowerShell-Saturday/tree/master/2019-NC.State/
A
How
many
raise
your
hand
if
you
work
in
IT
like
officially
working
some
IT
capacity,
direct
consulting
anything
like
that
yeah,
how
many
don't
work
in
IT
working,
something
totally
different,
but
do
IT
kind
of
stuff
point:
five,
okay
and
in
the
parish
ole
area.
Since
this
is
all
PowerShell.
How
many
of
you
have
installed
and
used
a
module.
A
A
There
we
go
now,
let's
say
thank
you
to
our
sponsors.
I
know
everybody
keeps
bringing
that
up,
but
it's
nice
that
they
did
this
the
food,
the
event
all
the
swag,
which
is
really
nice,
I,
still
can't
believe
they're
stickers
left
by
the
way
so
I'm
ground,
chocolatey,
plural,
site
script,
runner
system,
frontier
tech
systems.
Thank
you.
If
anybody's
hear
from
them.
Thank
you,
I
know.
If
you
are
right,
so
appreciate
it
much.
Thank
you.
A
So
will
I
just
parts
kind
of
I
hate
talking
about
myself:
I
live
in
Virginia
Beach,
it's
about
four
hours
away,
been
an
IT
since
the
80s
I
started
out
doing
programming
in
the
CAD
world,
so
I
used
to
work
a
lot
with
AutoCAD
and
things
like
that.
The
first
language
was
Lisp
way
back
and
move
from
that
into
other
stuff
and
kind
of
moved
into
mainstream
IT,
I
guess
around
2007-2008
tyrella.
A
When
the
market
crashed
a
weird
time
and
about
that
time
was
when
I
started
to
appreciate
scripting
in
general
back,
then
it
was
what
batch
and
VB
script
and
some
people
were
doing
active
parole
and
things
like
that
at
the
time
and
kickstart.
Anybody,
wherever
kickstart,
okay,
I,
know
a
lot
of
cool
stuff
with
kickstart
that
I
kind
of
missed.
When
it
kind
of
got,
kicked
to
the
wayside
or
the
pun,
then
PowerShell
came
along
and
kind
of
filled
that
gap
and
then
some
so
they
took
off
a
lot
better
and
more
pervasive
than
I.
A
Think
a
lot
of
people
expected.
We
were
talking
about
that
at
lunch
by
the
way
anybody
remember
project
monad
when
it
first
came
out.
Nobody
so
we'll
the
code
names
when
they
first
put
out
here
comes
monad,
it's
a
new
scripting
thing
and
it
was
like.
Why
is
there
a
new
script?
Anything
we
have
VB
script,
and
here
we
are
right.
So
that's
why
so
anyways
my
background
since
then
is
kind
of
shifting
into
end
user
device
management.
The
way
I
got.
There
was
kind
of
a
weird
long
story:
I'll
spare
the
details.
A
I
was
writing.
Software
I
had
to
get
it
out
to
machines
in
a
particular
defense
company
and
became
best
friends
with
the
SMS
guy,
and
he
showed
me
how
to
deploy
software
and
it
went
from
there.
I
got
really
intrigued
with
what
it
takes
to
get
things
out
to
machines
and
then
manage
them
and
then
monitor
them
and
configure
them
for
drift.
A
lot
of
things
that
have
been
talked
about
in
other
sessions
here
so
I'll
be
referring
to
some
of
those
during
this
session.
So
eud
is
end
user
device
management.
A
A
Anybody
follow
me
on
Twitter
some,
how
many,
how
many
people
here
don't
use?
Twitter
use
Twitter,
don't
believe
all
that
garbage
about
Twitter
being
like
for
18
year
old
talk
about
Justin
Bieber!
It's
not
that
at
all,
and
it's
not
all
political
stuff,
there's
a
firehose
of
IT
information
on
there
and
a
lot
of
it's
from
these
guys
that
are
speaking
at
the
conference.
Mvps
Microsoft
program
managers
they're
all
on
Twitter
everything
that
they
do
hits
that
before
it
hits
anything
else.
A
So
if
you're
hitting
it,
if
you're
only
going
to
blogs
only
going
to
mailing
lists,
people
such-and-such
week,
newsletters
and
stuff
like
that,
you're
getting
it
late,
especially
InfoSec
cloud
things
like
that
that
stuff's
every
day
there's
something
new.
Every
day,
gotchas
tips
new
releases
of
things,
I
strongly
recommend.
You
know
they're
tuned
into
the
people
that
are
focused
on
the
topics
you're
interested
in
and
go
with
that
sorry.
A
A
How
many
of
you
have
a
github
account
one,
two,
three,
four,
five,
six,
seven,
eight
poster
you,
if
you
don't
have
a
github
account,
just
create
one
go
ahead
and
do
it
it's
free,
there's,
no
they're,
not
gonna
mail,
you
or
anything
or
spam.
You
enough!
The
nice
thing
is
you
can
look
at
a
lot
of
stuff
and
gradually
get
involved
with
it.
So
that's
been
brought
up
in
a
couple
of
sessions
that
you
can
the
whole
idea
of
github
is.
It
opens
up
a
two-way
communication
for
people
who
are
writing.
A
A
lot
of
these
utilities
will
talk
about
here
that
you
should
probably
seen
in
other
sessions.
So
these
really
cool
widget.
It's
like
wow,
that's
really
cool!
You
can
go
look
at
the
source
code
without
an
account
a
lot
of
times,
but
if
you
want
to
go
in
and
say,
hey
I'd
like
to
see
this
change
like
it's
not
working
for
me,
because
I
have
this
one-off
exception
or
you
can
have
something
for
it
put
in
an
issue
right.
It's
like
an
open
helpdesk
ticket
if
the
bear
leaks.
A
If
you
really
feel
motivated-
and
they
really
appreciate
it-
contribute
and
submit
a
pull
request,
it
says
you
know
here:
I
made
the
change,
take
a
look
at
it.
It
looks
good
roll
it
in
right.
So
somebody
session
was
on
DBA
tools.
Here,
no
he's
in
another
session.
He
was
talking
about
how
they
contributed
to
deviate
tools
and
how
many
people
are
involved
with
putting
in
community
content.
On
that
that's
a
good
example.
How
many
people
here
use
Visual
Studio
code
versus
ISE,
good?
Okay,
it's
a
tough
switch
for
some
people.
A
I
can
admit,
there's
still
time
to
our
fire.
Pi
C
at
least
start
using
Visual
Studio
code
you're
going
to
find
a
lot
of
benefit
to
it,
and
if
you
found
a
word
that
rhymes
with
module
dude
stumped,
you
number
one
and
no
I,
don't
look
like
a
Martian,
so
knows
who
I
am
on
Twitter?
Okay.
So
what
are
we
going
to
cover?
A
The
session
is
going
to
be
about
high-level
overview
of
modules.
We're
not
gonna
go
deep,
so
it's
gonna
be
more
about
how
to
find
modules
when
to
go
looking
for
modules
and
when
to
consider
writing
your
own
model.
So
we're
not
gonna
go
into
like
techniques
of
how
to
write
modules.
We
can
hit
some
of
that
during
a
question
and
answer
time.
This
is
just
more
about
when
to
buy
a
laptop
versus,
go
to
fries
and
buy
the
parts
and
make
one
okay,
that's
kind
of
a
good
analogy.
A
It's
like
people
think
all
the
time
in
terms
of
software
kind
of
being
its
own
thing,
there's
a
lot
of
parallels
to
the
real
world
in
software,
so
make
or
buy
versus
kind
of
things
which
is
out
there
and
won't
talk
about,
won't,
go
into
detail
views,
power,
Samantha's
development
techniques
or
words
that
run
with
modules.
Any
questions
yeah.
B
A
Module,
okay
touch
on
that;
actually,
okay,
cool
anybody
else,
okay,
throw
a
rock
at
me:
I'll
tend
to
roll
right
over
stuff.
So
where
are
we
at
there's
three
levels
of
pretty
much
anything
right,
whether
it's
programming
or
building
a
house
there's
basic,
creating
and
mastering
right?
So
we're
gonna
be
about
right.
There
good
thing,
my
animation
works
and
so
other
sessions
that
I
will
probably
refer
to
which
I
was
I,
wasn't
sure
of
the
timing
of
this
session.
A
I
thought
it'd
be
earlier,
and
these
guys
would
come
later,
but
regardless,
when
the
content
comes
out
for
this,
because
it's
being
recorded
and
whatnot
check
these
other
ones
out.
If
you
haven't
already
sat
in
them,
the
DVD
tool
session
is
really
good.
The
admin
sysadmin
Spath,
the
dev,
ops
event
logs,
which
Phil
bossman
covered
and
utilizing
pipelines,
and
also
what
Fernando
has
been
covering
on
security.
All
right
so
he's
here
today,
he'd
be
here
tomorrow,
so
check
it
out.
A
I'm,
not
gonna,
be
your
full
day
tomorrow,
unfortunately,
I
wish
I
was
but
I'll
leave
you
here
from
the
first
part.
So
what
are
modules?
Fathers
are
toolboxes
of
tools.
That's
really
all
they
are
not
really
unique
to
PowerShell.
Other
languages
have
parallels
to
that.
That
is,
you
can
bundle
them
into
something
given
a
name
it.
It
gives
you
some
portability
that
gives
you
some
encapsulation
and
also
gives
you
an
easier
way
to
share
it
by
publishing
it
all
right.
A
So
that's
one
of
the
advantages
of
the
modules
you
can
put
it
in
a
repo
or
a
gallery
of
PowerShell
gallery
and
find
it.
You
don't
have
to
go,
find
somebody's
site
and
go
oh
download
extract
put
it
in
here.
You
can
install
you
still
have
to
on
older
platforms
or
if
you
have
powershell
5.1
and
later
a
five
wouldn't
later
I
can't
remember
they
had
a
install
module.
A
A
Module
is
you
got
to
have
the
module
there
to
import
it
we'll
talk
about
what
installing
important
mean.
So
those
are
the
parallels
right.
So
a
module
could
be
a
modules
are
tend
to
be
context
oriented,
so
you
write
a
module.
It's
kind
of
focused
on
a
particular
subject
like
I,
have
a
toolbox
for
working
on
cars
or
our
toolbox
for
doing
electrical
work.
That's
kind
of
like
a
module.
I
have
a
module
for
exchange,
a
module
for
azure
ad,
a
module
for
System
Center
right.
A
So
the
idea
is
that
they're
all
the
stuff
that
it
provides
they're
all
kind
of
related,
so
get
set,
put
test,
show
all
those
different
variables
or
excuse
me.
Verbs
that
go
in
front
of
those
commands
are
all
somewhat
context
related,
that's
kind
of
one
of
the
sort
of
aspects
of
a
module
that
makes
it
different
from
a
script
right.
So
a
script
just
kind
of
just
you
get
the
script
and
everything
in
there
is
what's
there,
but
somebody
else
might
go
well.
How
do
I
discover
what's
in
that
script?
A
That
can
be
a
little
hard
to
do.
You
can
add
commenting
and
document,
in
which
case
you're,
almost
making
a
module
or
does
making
a
module,
and
it's
kind
of
self
discovering
you
get
exposes
a
lot
of
the
content
to
the
functions
and
also
makes
it
easier
to
document
it
automatically.
I'll
show
you
some
of
that
later.
That's
that
right
there
and
that's
another
kind
of
tool
and,
let's
see
so
powerseller
wanders
in
the
world.
This
is
where
I
talk,
and
this
is
what
animation
just
goes
in
the
background.
A
All
of
these
things
that
are
popping
up
have
modules
related
to
them.
Some
of
them
are
officially
supported
or
provoked,
and
some
of
them
are
community
a
lot
of
our
community
now,
so
people
will
make
their
own
module.
Ok,
this
vendor
gives
me
once
got
ten
functions
in
it.
I
need
a
hundreds.
I
got
all
these
other
things.
I
got
to
do
with
it
a
good
example.
This
morning
was
DBA
tolls.
A
They
were
comparing
it
to
the
sequel,
server
module
that
Microsoft
provides
and
previous
tools
that
are
out
there
like
sequel,
CMD
and
then
deviate
tools,
and
how
are
they
different,
Lee?
Well,
this
one
has
50
commandlets
in
it,
I
think
they
said,
are
60,
I,
forget
and
theirs
has
like
a
hundred
and
fifty,
but
cuz
there's
isn't
just
doing
sequel
operations.
They
didn't
really
cover
that
in
that
session,
because
I
use
it
for
a
lot
of
stuff.
A
Anybody
using
the
system
Center
uses
it
for
a
lot
of
stuff
from
just
the
database
side
to
actually
looking
at
the
server
like
how
much
memory
does
it
have?
What
are
the
files
looking
like?
What
are
the
auto
growth
settings
on
all
that
kind
of
stuff
you
can
interrogate.
You
can
some
cases
you
can
set
all
from
the
command
line.
So
that's
the
kind
of
power
that
a
module
gives
you
and
then
your
module
fits
in
over
there.
A
C
A
Can
use
for
anything
really
it's
projects,
work
home.
Anything
you'd
want
to
just
build
a
build,
a
tool
box
if
you're
building
a
home
toolbox
to
go
work
on
your
own
projects.
What
would
you
put
in
the
box
that
kind
of
things
so
I
have
a
friend
that
does
IOT
stuff
with
Raspberry
Pi
he's
playing
with
Windows,
10,
IOT
and
raspbian,
and
things
stuff
like
that
and
I
think
he's
trying
the
PowerShell
core
side
to
work
with
that
to
automate
some
home
automation
stuff.
So
he
was
time.
A
I
was
locking
his
doors,
turning
the
lights
on
and
off
so
I,
don't
know
where
he
is
on
that
right
now,
I
gotta
follow
up
on,
but
again
on
top
of
that.
So
when
you
build
a
module,
you
have
to
write
all
the
code
from
scratch.
No.
So
that's
kind
of
word.
This
goes
into
a
module,
can
lean
on
other
modules
I.
Do
it
all
the
time
most
people
that
write
them
don't
write
every
line
of
code?
They
might
have
they'll
go
this
far
and
they
go
oh
you
know.
So
it's
has
got
a
module.
A
That
does
that
better
than
I
could
write
it.
So
I'm
just
gonna
invoke
that
and
you
can
make
out
a
dependency
and
I'll
show
you
where
they
get
set
in
the
powershell
manifest
there,
which
is
the
descriptive
file.
It
tells
the
system.
What's
in
this
thing,
what's
it
called?
What
version
is
it
all?
That's
in
a
file
and
the
really
cool
thing
and
I'll
get
on
that
later
and
I,
keep
saying
that
is
when
you
set
these
dependencies
and
you
say:
install
module
and
your
module
needs
other
modules
windows.
A
A
lot
of
athlete,
grab
those
modules
and
install
them.
While
it's
installing
yours,
so
you
don't
have
to
tell
the
person
oh
you're
gonna
need
this
go,
get
that
go
get
that
okay,
so
I
ran
out
of
colors,
and
so
in
the
manifest,
which
is
the
PSD
one
file.
It's
a
JSON
ish
file
that
described
all
the
stuff.
One
of
the
lines
is
required
modules.
You
put
the
names,
you
can
daisy-chain
them
in
an
array
and
it
just
looks
down
the
list
and
checks
and
says:
do
you
have
it
you
have
it?
You?
A
Don't
ok
install
that
one
install
that
one?
That's
all
there's
a
bunch
of
built-in
commandments
for
modules,
there's
fine,
which
will
search
to
your
default
repository.
The
default
repository
on
Windows
10
is
powershell
gallery.
That's
powershell!
Gallery
comm,
you
can
add
others,
you
can
add
your
own
custom
ones.
There's
commandlets
built-in
for
adding
like
internal
repos
and
things
like
that
or
other
public
ones.
Also
get
is
basically
interrogating
your
machine
for.
What's
on
it,
there's
two
modes
generally
there's
a
each
of
these
has
a
lot
of
parameters.
A
You
can
use
to
do
other
things,
but
then,
when
you
just
type
in
that
commandment
and
hit
enter
it's
going
to
tell
you
what's
loaded
in
memory,
okay,
so
what's
actually
important
in
this
session
and
I
can
just
type
the
commands
and
go
if
you
type
in
that
with
list
available,
it'll
show
you
all
the
ones
that
are
installed
on
the
system,
but
may
not
necessarily
be
loaded.
Now
that
used
to
be
a
bigger
thing
in
the
past.
But
now
you
have
Auto
loading.
A
A
It
was
like
600
and
some
I
forget,
so
they
actually
started
doing
what
a
sure
doesn't
break
them
out
by
focus
like
networking
storage
to
get
their
numbers
smaller.
So
you
only
load
the
small
numbers
you
need,
rather
than
try
to
load
everything,
so
import
module
loads
it
from
the
system.
Again,
you
don't
really
need
to
do
that
now.
As
far
as
I've
seen
correct
me
if
I'm
wrong,
but
I
haven't
seen
a
need
to
actually
explicitly
import
module
anymore,
remove
module,
takes
it
out
of
memory,
doesn't
take
it
off
the
system.
A
That's
a
point
of
confusion
for
some
people.
They
think
it
means
a
ton
installs
it
just
unloads
it
from
the
session.
Install
module
goes
and
gets
it
from
wherever
you
tell
it,
you
can
say
install
it
from
file
share
or
from
a
repo.
The
default
is
a
repo,
so
PowerShell
galleries,
where
it's
going
to
look
from
so.
A
Module
space
DBA
tools,
it's
going
to
go
to
the
powershell
gallery
and
look
for
it
and
install
it,
and
installing
I'll
show
you
what
that
does
minute.
Uninstall
removes
it
from
your
machine:
update
module,
updates
it
okay,
so
some
of
these
have
some
caveats
to
them.
I'll
get
into
that
later,
but
any
questions
before
we
move
on
from
here,
okay
sounds
is
accepted,
so
find
module.
There's
an
example,
and
it
comes
back
with
that.
If
it
doesn't
find
it,
you
get
enough
or
al-hussein
didn't
find
it.
A
So
I
give
you
the
version,
the
name,
the
repo
and
that's
that
returns
an
object
just
like
everything
in
PowerShell,
so
you
can
actually
set
that
to
a
very
real,
like
dollar
sign
x,
equals
fine
module
and
then
pipe
that
out.
Look
at
the
properties!
Look
at
the
description,
all
the
details.
What's
really
cool
is
by
default.
When
you
ask
for
an
object
in
PowerShell,
it
gives
you
a
very
minimal
set,
even
though
what
was
passed
back
was
a
full
set
of
information.
A
A
A
A
A
A
That
are
compiled.
This
is
a
good
example.
You'll
see
some
dll's
and
some
of
them
where
they
compile
them.
This
is
I
actually
open.
So
we
are
all
ps1
J's
JSON.
You
can
easily
look
at
them
and
go
to
their
either
here
or
in
the
project
side,
which
would
be
github
usually-
and
if
you
do
this
through
PowerShell
and
pull
it
back,
you
get
the
same
thing
so
license
info
contact
owners.
A
Okay,
look
at
dollar
sign
down
just
the
bare
basics
right,
so
do
that
and
you
select
star
you
can
see
it's
actually
a
lot
more
coming
back
right.
It's
all
the
commandments
that
were
in
there
everything
you
saw
end
up
in
the
portal,
so
they're
just
exposing
it
to
an
HTML
front-end.
But
you
know
what
you
can
do
with
this.
Whatever
you
can
think
of
you
know,
just
like
everything
in
PowerShell
they're,
just
Lego
blocks,
you
can
put
them
together
to
build
anything.
A
You
want
so
I've
seen
people
take
the
fine
module
output
and
use
it
for
automating
stuff
from
documentation
to
all
sorts
of
thing.
So
you
get
all
the
information
in
here
that
you
would
get
in
the
portal.
Okay,
let's
see
no
dependencies
and
that
one's
everything's
self-contained.
A
And
then
showing
you
that
that's
the
same
thing
right
and
then
actually
pointing
to
that.
So
by
that
I
mean
partial
gallery
and
so
finding
modules
Dena
we're
gonna,
find
the
module
and
show
how
you
find
water
so
think
of
what
he
showed
you
that
somewhat.
But
let's
say
it's
a
little
bit
limited
in
how
certain
syntax
is.
There's
four
one
I've
seen
so
anybody
here
use
chocolaty
anybody
familiar
with
it.
Okay,
one,
ok
chocolaty
is
a
powershell.
I
want
to
say
module.
It
is
modulus
has
more
than
one
module.
A
It's
a
PowerShell
layer,
I
guess:
you'd
call
it
for
automating
installing
software
and
making
configurations.
If
you
used
to,
if
you've
heard,
worked
on
Linux,
it's
similar
to
app
get
or
young,
so
you
just
say:
hey
I
need
seven
to
go,
get
it
I,
don't
need
to
go,
find
seven.
It
goes
to
the
repository
again
and
finds
it
brings
it
down.
A
A
And
I
say:
GPO
I'm
finding
for
my
define,
module,
GPO
doc.
Shameless
blog
here
battling
finds
module
MSB.
When
I
wrote,
that's
why
I
knew
the
name
of
it.
So
it's
a
little
bit
a
a
little
bit
limited
in
how
you
can
search
so
you
most
people
will
find
that
it's
a
little
faster
to
just
go
powershell
gallery
and
search
it.
You
can't
do
it
from
the
command
line,
but
I
haven't
found
a
way
to
do
it
here.
You
can
do.
B
A
A
Okay,
where
do
they
getting
stopped
any
questions
before
I
move
on?
No
all
right,
where
do
modules
get
installed
on
your
system,
depending
on
the
operating
system
version
you're
on
and
whether
you're
running
as
an
administrator
or
not?
You
can
install
modules
by
the
way
is
system
wide
or
under
your
user
context.
Okay,
like
some
software,
let
you
do
that.
If
you
install
them
under
system
context,
they
generally
will
go
under
Program
Files.
A
A
Okay,
so
I'll
touch
on
the
path,
there's
also
a
default
path,
just
like
don't
look
like
Windows
has
a
path
statement
where
it's
a
chain
of
paths
that
it
looks
through
when
you
type
a
command,
so
if
I
just
type
in
robocopy
or
xcopy.
Where
does
it
finally
exe
for
that
in
the
default
path?
Powershell
is
the
same
way.
It
extends
the
path
to
the
modules
path
and
some
other
things.
A
So
as
long
as
you
put
things
in
those
places,
it'll
find
them-
or
you
can
add
your
own
path
to
that
which
you'll
see
a
lot
of
modules
will
do
that
chocolaty.
Does
that
it'll
do
plus
sequels
and
add
their
path
to
your
path,
so
you
don't
have
to
go,
find
it
or
anything
it'll
just
be
there.
Windows
will
find
it
so
to
do
that.
Well,
typically,
do
is
create
a
folder
for
the
name
of
the
module
under
modules,
the
version
and
then
extract
everything
under
that.
Okay
and
if.
A
So,
if
you
move
things
around,
it
may
say:
I
don't
know
where
I'm
at
and
just
try
to
stick
to
a
standard.
Usually
works
pretty
well
just
I'm,
not
dinging.
Anybody
and
I've
done
it.
So
there's
that
there's
the
path,
so
if
you
type
it
environment,
so
in
PowerShell
anybody
familiar
with
the
env
environment
variable
in
PowerShell,
you
may
not
familiar
with
it.
Okay,
it's
like
the
path
statement
in
Windows
or
dos
the
old
command.
Shell
type
in
path
same
thing
comes
in
with
semicolons.
C
A
A
So
if
you
have
any
developers
in
the
environment
and
they're
loading
modules
on
their
machines
under
their
User
Profile
and
you
sent
out
a
system-wide
one
and
they're
not
seeing
change,
it
can
be
a
naming
conflict
where
it's
looking
at
the
one
under
their
profile.
First
and
ignoring
the
system,
one.
Okay,
any
questions.
A
Ok
installations,
I
already
covered
this
to
showing
you
the
folder
structure,
that's
for
system
and
user
and
breakdown
on
the
folder
and
version
a
generic
retention.
So
sorry,
this
was
gonna.
Go
so
modify
permissions
on
a
folder.
So
the
idea
of
this
is
let's
say
it's
hard.
It's
sometimes
people
have
a
hard
time
like
I.
Do
learning
something
just
for
the
sake
of
learning
it.
You
have
to
have
a
scenario.
Memeing
I
need
a
problem
to
solve.
I
need
to
copy
this
file
up
to
50
machines.
A
A
A
A
A
You're
still
going
to
write
some
code
to
read
back
information
from
a
database,
whether
you
do
it
in
one
tool
or
another,
doesn't
matter
read
from
an
Excel
spreadsheet
file,
especially
if
you're
on
a
machine
that
doesn't
have
Excel,
let's
say
you're
on
a
server
and
they
don't
install
it
said
Excel,
but
you
need
to
be
able
to
read
this
information
because
the
job
has
to
run
here.
It
ain't
gonna,
run
anywhere
else,
but
the
this
spreadsheet,
wherever
it
is,
has
to
be
read
from
here
and
I.
Don't
have
Excel
in
this
machine.
A
How
do
you
deal
with
that?
So
cover
that
and
then
blue?
Those
are
the
modules
that
I
would
typically
use
for
those.
There
are
other
modules
for
some
of
these,
these
are
just
the
most
common
ones,
check
front,
install
Windows
updates,
so
PS
Windows
Update
is
a
common
one
and
render
gated
over
webpages.
That's
a
project
of
mine,
so
shameless
plug.
We
have
time,
don't
talk
about
that
one
demo
one.
So
the
idea
of
this
one
is
modifying
permissions
on
a
folder
there's
a
couple
ways
to
do.
A
A
Not
aware
of
that,
and
probably
most
you
are,
but
in
case
anybody's,
not
there's
a
common
perception
that
you
can
only
do
PowerShell
in
PowerShell
and
that's
not
true,
you
can
run
any
tool
through
PowerShell
and
you
don't
always
have
to
wrap
it
in
an
invocation
or
start
command.
You
can
just
say
dirt
or
Rd
to
remove
a
directory.
You
can
also
do
I,
cackles,
xcopy
robocopy.
B
A
A
A
It's
already
got
a
really
beautiful,
robust
air
handler
gets
me
back.
Nice
pretty
airs
it
handles
all
the
exceptions
that
I'd
be
running
into
put
it
in
a
test
environment
and
verify
it
talk
to
friends.
Yeah
I
use
this
one.
It
works
great,
we
use
it.
You
know
corporation
XYZ
for
years,
and
it's
great
okay,
I'll,
try
it
then
you're
going
to
go.
Oh
that
saved
me.
A
Twenty
thirty,
a
hundred
a
thousand
lines
of
code
by
one
line,
so
here's
an
example
using
carbon
carbon
Zamora,
Swiss
Army
knife
of
utilities
for
Windows
has
all
kinds
of
stuff,
but
we
use
a
lot
in
DevOps.
We
use
it
a
lot
in
just
general
system
configuration
automation,
so
you
can
do
things
like
check
for
and
set
who
can
run
as
a
service
things
like
that,
a
lot
of
times
people
do
it
with
a
GPO
okay.
Well,
what?
If
you
just
want
to
do
it
on
one
server?
A
Is
it
worth
spinning
up
all
GPO
and
I
know
you
security
filtering
for
that,
or
just
run
up
one
line
and
dump
tailing
off
of
John
Morgan's
session
earlier
on
using
PowerShell
for
configuration
items
to
do
to
control
configuration
drift
of
things
you
can
use
that
same
approach
within
config
manager.
To
look
for
is
that
out?
Ok,
then
fire
this
at
it
to
fix
it
and
do
I
need
to
write
20
lines
or
can
I
call
a
module
and
do
it
one
line.
So
that's
all
one
line
I
just
have
to
split
it
to
fit.
A
So
that's
that
you
see
in
front
of
it.
So
most
modules
don't
prefix
their
commandlets
with
a
common
prefix.
So
it's
easier
to
kind
of
do
a
filter
on
the
names
of
the
commands,
though
you
don't
have
to,
but
it's
recommended
also,
if
they
just
said
grant
permission
and
microsoft
had
a
grant
permission.
You'd
get
name
conflicts
confused,
so
there's
all
have
grants
see
this
test,
see
that
so
the
folder
path,
the
identity,
needs
a
group
name.
So
in
that
case
it's
two
variables.
What
forward
what
group
it
says?
A
Okay,
I
want
to
grant
permission
full
on
that
folder
to
that
group
and
applied
to
I
know
it's
a
long
enumeration,
but
it's
container
and
child
containers
and
child
leaves
means.
This
is
up
this
folder
and
subfolder
and
all
files.
So,
if
you're
used
to
looking
in
the
GUI,
that's
with
that
same
thing
and
title
out
so
saying
out
loud,
not
deny
so
one
line
I
can
grant
permissions
on
files
and
folders
I
can
put
that
in
a
loop
and
hit
a
hundred
thousand
folders.
A
This
example
here
came
from
a
project
where
we
had
to
hit
like
75
or
100
machines
scattered
around.
They
were
all
on
the
line
that
they
are
all
online
at
that
time
and
open
up
permissions
on
a
folder
like
right.
Now
we
couldn't
like
deploy
it.
Wait
for
it
had
to
happen.
Right
now
is
was
holding
people
up
so
whatever
half
they
were
using,
wasn't
able
to
write
to
a
folder
that
let
them
do
it.
A
B
A
Folders
registry
services
processes
security,
it's
ranked
pretty
high
in
the
PowerShell
gallery,
which
has
a
popularity
rating
of
who
downloads
stuff
the
most
same
with
chocolaty
so
check
it
out.
They
didn't
pay
me
for
that.
Either
get
results
from
databases
and
DBA
tools,
DBA
tools
as
a
module
digits
for
sequel
server.
It
just
capsule
eights,
a
bunch
of
commands
that
used
to
have
to
do
a
lot.
More
writing
to
do
things
like
querying
databases,
riding
the
tables
reading
from
them.
Give
me
a
list
of
the
tables.
Give
me
a
list
of
views,
store
procedures.
Functions.
A
Tell
me
about
the
server.
Tell
me
about
the
databases.
You
know
you
can
back
out,
look
at
it
from
a
DBA
level
or
down
at
a
developer
level.
So
in
this
case
this
example
is
you
know
what
server
DVD
one
two
three:
what
database
there's
this
sequel
query
expression,
which
is
just
select
distinct
name
from
workstations
where
Department
equals
five
and
they
just
fired
off.
That
comes
by
with
an
array
like
a
record
set.
A
A
The
way
I'm
trying
to
even
cover
that
so
I
work
as
a
consultant
by
going
a
lot
of
customer
environments
and
it's
never
the
same
thing.
It's
always
something
different
when
I
go
in
one
of
the
common
things.
I
see
is
lot
of
people
making
their
own
tools
and
they
don't
need
to
it's
real
common
and
people
are,
you
know
already.
Everybody
here
is
probably
familiar
with
do
more
with
less
and
now
great
congratulations.
A
A
Now
you
got
three
things
to
do
and
they
always
say
it
takes
time
to
save
time
right
so
you're,
like
oh
great
I,
need
to
automate
I,
don't
have
time
to
automate
I'm
too
busy
putting
out
fires.
Well,
one
of
the
quickest
ways
you
can
do
things
is
when
you
get
ready
to
start
the
next
task,
try
not
to
go.
Do
it
all
yourself.
A
B
A
Nice
module
for
reading
and
writing
excel
even
without
excel
on
the
machine,
so
you
don't
need
excel
on
the
machine
to
do
that.
So
there's
plenty
of
tools:
it'll
like
open
up
Excel
under
the
hood,
a
lot
of
them
use,
column,
they'll,
say
you
know,
new
object
type
is
comm
excel
that
application
and
then
go
do
all
that
or
they'll
just
launch
command
line.
You
don't
even
need
that
there.
It
is
it's
one
line.
So
actually
that's
two
lines.
One
says
give
me
the.
C
A
When
this
is
give
me,
the
names
I'm
actually
going
to
demo
this
here
in
a
minute
I'm
doing
okay
in
town,
right,
I,
think
I'm
close
all
right
so
check
in
from
dates,
get
Windows
Update
a
one-liner
for
patching
machines
and
there's
also
a
computer
named
argument.
So
you
can
fire
this
off
against
a
list
of
machines
right.
A
So
if
you
don't
have
System
Center,
you
don't
have
wsus
or
you
do,
and
you
just
need
to
do
something
one-off,
like
you
know,
I
have
wsus,
but
I
can't
wait
for
these
machines
to
go
through
that
cycle.
I
need
to
patch
them
now
before
they
go
off
the
workbench,
because
I
got
to
do
like
100
at
a
time
and
get
them
out
the
door.
A
I've
also
seen
this
used
in
TAS
sequences
I
actually
have
a
customer
right
now
that
in
SCCM
with
a
TAS
sequences
it
does
a
bare-metal
Windows
10
install
firing
that
off
at
one
of
the
remote
offices,
because
they
don't
have
a
DP
number
one,
that
another
distribution
point
server
for
anybody's,
not
familiar
system
Center.
It's
like
a
local
server
thing
go
to.
A
Instead
of
having
to
go
all
the
way
back
to
corporate
they're,
just
using
that
wand
right
there
to
say,
go,
give
me
all
the
updates
just
patch
the
machine
not
perfect,
not
ideal,
not
always
recommended,
but
it
works
for
them
and
they
only
have
two
guys
maintaining
a
pretty
busy
operation,
so
that
saves
them
a
ton
of
work
having
to
worry
about
patching
brought
their
patch
compliant.
It's.
A
Like
98
percent,
or
they
were
like
at
55,
so
one
line
of
code
they
didn't
have
to
go,
write,
anything
or
figure
it
out.
It
was
also
a
YouTube
video
I'll
link
down
here
at
the
bottom
that
sorry,
but
to
the
other
slide,
that's
a
goof
on
my
part.
That's
for
Excel
any
questions
before
I
move
on
kind
of
falling
through
this.
A
There's
a
lot
of
modules
out
there
ready
to
use.
So
if
you
have
Active
Directory
installed
or
are
sat
on
your
workstation,
you
can
use
get
ad
computer
or
a
T
group
member
in
this
case,
I
just
want
to
get
the
names
of
things
that
are
in
a
group.
This
happens
to
be
a
group
of
computers.
I
want
to
get
the
name
property,
so
you'll
see
people
do
get
and
then
pipe
to
select
name.
A
This
is
the
same
thing
as
doing
select
expand
property,
so
you
don't
get
back
to
heading
with
the
values
you
get
back.
Just
the
values
sound,
familiar.
Okay,
that's
a
shorthand
way
of
doing
it.
The
downside
is
by
the
way,
if
you
screw
up
the
middle
of
it
and
it
blows
up
air
handing
is
a
little
weird,
but
there's
ways
around
that.
If
you
don't
have.
B
B
A
Trying
to
stuff
a
cat
bathtub,
so
yeah,
if
you,
if
you
don't
thank
you
by
the
way,
if
you
don't
have,
if
you're
not
on
a
domain
controller-
and
you
don't
have
our
sad
song.
So
anybody
not
familiar
with
what
our
sad
is.
I
keep
throwing
that
name
out
there,
everybody's
good
with
that.
Okay,
if
you
don't
have
our
set,
you
don't
have
the
the
group
policy
or
excuse
me,
the
Active
Directory
PowerShell
module
that
it
installs.
A
There
is
another
module
you
can
install
and
you
can
install
it
as
user
context,
which
is
ATS,
IPs,
okay,
and
it
just
uses
the
older
ADSI
interface
to
get
to
Active
Directory.
It's
got
almost
all
the
same
commands,
not
not
all
of
them,
but
it
has
a
lot
of
them.
Like
group,
get
group
gets
group,
member
user,
all
that
stuff
and
the
properties
it
returns
are
almost
identical
or
the
format.
So
it's
a
really
nice
fallback
have
some
people
that
use
that
where
they
are
not
allowed
to
install
our
set,
they
don't
have
having
rights.
A
They're
not
allowed
to
have
our
set
because
InfoSec
doesn't
one
we
have
it,
but
they
still
have
to
get
a
list
of
computer
names
to
do
whatever
they
do
for
their
job.
So
that
gets
a
mine.
They
can
install
it
their
user
context
and
use
that
one.
So
if
there's
any
InfoSec
people
watching
this
going,
how
dare
he
and
just
give
them
a
workaround?
A
Sorry,
okay,
I
know
I
kind
of
blasted
through
this.
I
think
we're
almost
out
of
time.
These
are
some
modules
I've
covered
and
a
few
I
didn't
really
have
time
to
cover.
If
you
do
any
imaging
of
Windows,
10
OS
d
builder
is
really
nice.
That's
a
PowerShell
module
that'll!
Let
you
prepare
your
own
custom
images
for
Windows
10,
so
extract
ISO,
patched
a
scope
with
the
service
updates.
A
Cumulative
update,
take
out,
features
and
features
like
dotnet,
3,
5,
remove,
candy
crush
and
then,
when
it's
done
packing
up
into
a
thumbdrive
iso
wim
file
folder
share.
So
you
can
take
that
pump
it
right
into
SCCM
and
use
that
as
a
more
or
less
a
C,
ICD
type
approach
to
keeping
your
imaging,
up-to-date,
so
you're,
not
always
depending
on
the
task
sequence
to
patch
the
Machine.
After
its
image,
you
can
have
it
come
in
already
close
to
being
fully
patched
pause.
365
is
written
by
a
friend
of
mine,
shout
to
Kevin
fluid
film.
A
B
A
Ps
is
for
making
markdown
files
I've
covered
that
in
a
PowerShell
meetup
for
Charlotte
take
a
month
ago
or
two
months
ago,
documenting
your
code.
So
if
you
do
comment
based
L
in
your
code,
if
you
just
do
your
little
tags
and
put
any
or
description
synopsis,
description
parameter
and
all
that
you
document
it
that
will
pull
it
out
and
generate
markdown
files
for
you,
a
lot
of
places
will
use
that
to
automatic
document
their
stuff.
So
so.
B
A
A
Basically,
you
want
to
write
a
bunch
of
functions
that
deal
with
this
internal
purchase
order
system
and
maybe
link
it
up
to
whatever
else
your
asset
inventory
system,
you
might
have
a
whole
library
of
functions.
You
might
have
one
PS
file,
ps1
file.
It
has
again
a
set.
Give
me
the
users
get
me.
The
POS
give
me
the
ones
that
are
open.
The
ones
that
are
closed.
Give
me
a
by
department.
Give
me
a
by
type
of
thing
whatever
by
location.
A
Whatever
you
might
have
this
whole
growing
library,
rather
than
passing
that
file
around
you
could
make
it
part
of
a
module
and
that
easier
you
install
it.
You
expose
those
files
or
those
fun
as
more
more
cleanly,
and
you
can
also
provide
better
documentation
and
support.
So
the
idea
is
that
you
take
one
ps1
file
and
you
have
a
collection
of
these
script
files
right.
Each
of
them
is
seen
notice.
The
syntax
in
there
I
have
a
parameter
set.
There's
no
word
function
in
those
I,
don't
have
any
functions.
These
are
just
standalone
scripts.
A
C
A
Got
crazy
with
the
animation
here
sorry
and
save
your
manifest
that
describes
it.
You
have
your
PS
m1,
which
can
either
load
the
functions
from
your
files,
its
acts
like
a
traffic
cop.
If
you
will,
this
is
one
way
to
do
it
so
I
call
it
any
and
here's
your
script
that
you
had
you
take
it
and
convert
it
to
a
function.
Then
all
you
do
is
wrap
it
essentially
right,
and
that
goes
in
and
becomes
your
module
function
comes
up
for
animation,.
A
The
other
way
you
can
do
it
you'll
see
commonly
is
people
will
just
take
all
those
and
just
put
them
in
one
PSM,
one
file,
which
is
essentially
like
a
ps1
with
everything
in
it,
and
so
what
are
the
one
of
the
advantages?
If
I
install
a
module
I
don't
have
to
find
the
folder
where
I
put
those
ps1
files
I
have
a
modular
I'll
have
to
do
is
just
type
the
function
name.
Windows
is
gonna,
find
it
run
it
so.
B
If
I've
got
multiple
functions
within
a
ps1
file,
I
started
off
just
my
my
initial
package.
Yeah
is
all
of
all
of
the
functions
that
are
related
to
doing
it.
This
specific
tasks
are
in
one
ps1
file.
Is
that
a
fairly
straightforward?
You
know
it
just
rename
it
as
a
PS
m
1
PS
m
1
file
pretty
much,
but
then
I
need
the
PSD
yeah
and
there's
a
way
to
create.
A
That
there's
a
function
called
new
module
mark
new
module,
manifest
you
type
inyou,
pointing
it
has
some
parameters
like
okay:
what's
the
module
you,
you
put
it
the
path
to
the
PSM
one
file,
and
then
you
give
it
the
name.
I.
Think
the
past
statement
is
gonna,
be
like
the
name
of
it
dot,
PSD
one
and
then
you
can
fill
out
the
rest
or
it'll
just
fill
out
a
blank
template.
You
can
fill
it
in
later,
like
oh,
it.
B
A
Because
they
want
you
to
control
what
you
want
exposed
to
the
user,
you
can
hide
those,
so
you
can
have
like
health
helper
functions
like
okay,
here's,
the
ones
I
want
you
to
use,
but
this
one's
gonna
call
someone
my
private
functions.
If
you
will
you
don't
have
to
expose
those
like
DBA
tools?
Almost
all
these
modules
of
talking
about
have
private
and
public
functions
for
the
most
part.
Some
of
them
are
very
trivial.
Like
just
go,
find
this
stuff.
A
C
A
Thank
you
right
there.
So
you'd
have
an
array
that
would
you
tell
the
names
of
the
functions?
Okay,
so
that's
option
B!
You
just
put
everything
in
one
file:
that's
fine!
If
you're
doing
a
small
project-
and
it's
only
one
of
you
working
on
it,
but
if
you
have
a
team
working
on
it,
they're
gonna
split
up
who's
working
on
what
you
probably
want
to
do
separate
files.
It's
a
lot
easier
that
way.
Okay,
you
take
that
function.
A
You
take
that
function,
everybody
just
check
their
stuff,
you
know,
and
then
you
wouldn't
really
have
to
import
module
but
there.
So
if
you're
not
pulling
it
off
the
gallery,
you
still
would
do
import
if
it's
coming
from
like
a
network
share,
it's
one
time
and
you
wouldn't
use
import
function
like
import
or
season
the
import
module,
import
module
from
my
internal
server
and
then
use
my
function
because
it's
not
going
to
just
find
it.
There's
none
it's
in
the
default
yeah!
Okay.
A
Best
practices
number
one
get
it
work
in
it
too.
Many
people
get
really
wrapped
around
the
axle
when
they
first
start
right
into
module.
Trying
to
make
it
perfect
right
out
of
the
gate.
Don't
worry
about
that.
Just
make
sure
that
break
anything
and
it
doesn't
even
CPU
a
lot.
Okay,
just
make
sure
it
works,
it
finishes
and
it
gets
by.
It
may
not
be
pretty.
You
can
always
pretty
it
up,
but
that's
step.
One
is
to
get
it
worked
out.
A
That's
assuming
you
for
done,
step,
2,
clean
it
up
at
some
documentation,
it's
important
to
add
documentation.
I
can't
stress
that
enough,
because
you
might
go
home
one
day
and
get
hit
by
a
bus.
Next
guys,
not
gonna,
know
what
you
were
working
on.
What
does
this
thing
do
pick
another
guy,
throw
it
away?
No
don't
throw
it
away.
That
thing
was
critical
to
the
payrolls,
I've
seen
an
amp
and
then
three
clean
it
up
later.