Administration and Automation with Windows PowerShell
Course Introduction • 5min
0 / 2 lessons complete
Getting Started with Windows PowerShell • 42min
0 / 7 lessons complete
The Basics of PowerShell
Video | 7 min
Installing and Updating PowerShell
Video | 7 min
The Text Based Console Part 1- An Overview
Video | 7 min
Text Based Console Part 2 - An Overview
Video | 5 min
The ISE (Intelligent Scripting Environment) Part 1
Video | 5 min
The ISE (Intelligent Scripting Environment) Part 2
Video | 5 min
Use the OGV Command to Easily View console data!
Video | 6 min
Getting Help and Finding Commands • 39min
0 / 6 lessons complete
Getting Help and Finding Commands Part 1
Video | 7 min
Getting Help and Finding Commands Part 2
Video | 3 min
Getting Help and Finding Commands Part 3
Video | 4 min
Help System LAB Questions
Video | 6 min
Help System Lab Answers 1-4
Video | 9 min
Help System Lab Answers 5-9
Video | 10 min
PowerShell Command Syntax • 33min
0 / 5 lessons complete
Command Syntax Part 1
Video | 8 min
Command Syntax Part 2
Video | 8 min
Command Syntax Part 3
Video | 5 min
Command Syntax Lab Questions
Video | 4 min
Command Syntax Lab Answers
Video | 8 min
PowerShell Objects and Properties • 35min
0 / 6 lessons complete
Objects, Properties and Methods Part 1
Video | 3 min
Objects, Properties and Methods Part 2
Video | 8 min
Objects, Properties and Methods Part 3
Video | 7 min
Questions 1-9 for Objects, Properties and Methods
Video | 2 min
Answers to Questions 1-7 O-P-M
Video | 11 min
Answers to Questions 8,9 O-P-M
Video | 4 min
The PowerShell Pipeline • 24min
0 / 2 lessons complete
PowerShell Providers • 30min
0 / 5 lessons complete
What are PowerShell Providers
Video | 3 min
Using PS Drive
Video | 6 min
PowerShell Provider CMDlets -1
Video | 12 min
PowerShell Providers CMDlets -2
Video | 7 min
Student Assignments
Text | 2 min
PowerShell Arrays and Variables • 28min
0 / 4 lessons complete
PowerShell Variables
Video | 9 min
PowerShell Arrays
Video | 12 min
PowerShell Variables Challenge
Video | 2 min
PowerShell Variables Solution
Video | 5 min
PowerShell Loops • 19min
0 / 3 lessons complete
PowerShell Conditional Statements • 11min
0 / 1 lessons complete
On Premises Lab Setup • 36min
0 / 8 lessons complete
Should You Watch This Section?
Video | 2 min
Downloading and Installing VirtualBox
Video | 2 min
Downloading Windows Server 2019
Video | 3 min
Creating Your Virtual Network
Video | 2 min
Creating Your Virtual Machines
Video | 7 min
Installing VirtualBox Guest Additions
Video | 2 min
Installing Windows Server
Video | 8 min
Installing the Active Directory Domain Services Role
Video | 10 min
Basic Domain Administration with Windows PowerShell • 2hr 27min
0 / 10 lessons complete
Configuring PowerShell Execution Policy with Group Policy
Video | 13 min
Installing Windows Server Roles and Features with Powershell
Video | 6 min
Running Powershell Scripts as Scheduled Tasks
Video | 8 min
Creating Organizational Units with Powershell
Video | 11 min
Creating and Managing Active Directory User Accounts with PowerShell
Video | 19 min
Move all AD Users in a Group to a Specific Organizational Unit
Video | 7 min
Generate a list of AD Users and their OU
Video | 5 min
PowerShell Splatting
Video | 5 min
Bulk Install Windows MSU Files Automatically with PowerShell
Video | 13 min
Lab: Domain Administration with Windows PowerShell
Lab | 60 min
Send Emails with PowerShell • 22min
0 / 2 lessons complete
Send Emails from Gmail with PowerShell
Video | 9 min
Create Password Expiration Notification Script
Video | 13 min
PowerShell Desired State Configuration (DSC) Basics • 1hr 48min
0 / 6 lessons complete
DSC Overview
Video | 9 min
Enabling PSRemoting with Group Policy
Video | 9 min
The DSC Resource Kit
Video | 7 min
Configuring The Local Config Manager for DSC Push
Free lesson
Video | 14 min
Uninstalling Windows Features with DSC
Video | 9 min
Lab: Desired State Configuration (DSC)
Lab | 60 min
Course Conclusion • 1min
0 / 1 lessons complete
Sign up to access this lesson
Click here to sign up and get access to this lesson!

Saving Progress...
Command Syntax Part 2
How do you tell which Parameters are optional and which arguments are required?
To answer that question we need PowerShell’s Help system
Type help get-service -showwindow
Scroll down to the Syntax section and what I have done is I’ve copied the Syntax section into
my scripting Pane. So you can use show window and I’ll view the syntax from the scripting
pane.
Now watch this I’m going to type get-service, notice that this cmdlet runs without adding
any parameters.
Now check this out type get-eventlog press return, notice what it says:

So, the question is why did get-service run when get-eventlog required a value for the -logname parameter?
1 The answer is in the syntax of the help files for get-service and get-eventlog
Lets checkout get-service first. Let’s start with parameter set #2 and set #3
Optional [Parameter Argument] Notice that all the parameters and the arguments are
surrounded by square brackets.
This means that adding the parameters are optional and not needed. So,
2 Get-service will run without adding any parameters.
Now let’s take a look at the syntax for get-eventlog
If you want to follow along type help get-eventlog -showwindow
Again I’ve copied the syntax for get-eventlog to my scripting pane
Let’s go through the syntax, notice that almost every parameter and every argument are
surrounded by square brackets, that means that they are all optional or not needed.
Notice -logname is surrounded by square brackets but the argument is not.
Required Argument
That means, because there are square brackets around the parameter -logname, the name
logname is optional but the argument <string> is required.
That is why when you ran get-eventlog without any parameters, PowerShell asks for a
value for -logname
Now go back to get-eventlog, logname:
type Application and press return, and the command runs.
3 Let’s go ahead and clear the screen cls
4 Positional parameters [Param] (Use get-eventlog scroll down to #Position)
Type help get-eventlog -showwindow
Scroll down until you see the parameter attributes list. We are going to be working with
three parameters from this list, -InstanceID, -logname and -newest
From the list notice that the parameter -logname has a position of 0,
-InstanceID has a position of 1 and -newest has a position of named.
Now what does this mean?
0, 1 and name, refer to the actual position that the cmdlet must be placed in the order of
the cmdlets.
So -logname is positional, it’s position is 0 which is the first position.
The parameter -instanceID position is 1 which is after -logname in the order of cmdlets
Ok let's check that out
So type get-eventlog application 0,1
(I don’t have to type the parameter -logname or the parameter -InstanceID, because they
are both optional because they're surrounded by square brackets
Now take a look at the argument for -InstanceID because there are two square brackets
within the angle brackets the parameter -InstanceID can take multiple arguments. Now
press return and that runs.
Now let's see if we can move these values out of order. Move the 0,1 in front of
application and press return.
And we get an error because Powershell expects the positional parameter -logname or the
value type application to be 5 the first in the list.
6 Named Parameters
Take a look at -Newest, notice that the position is named.
Named means that you can put -newest anywhere in the order of parameters and it will
work. Let’s check it out
Type get-eventlog -newest 5 application 0,1 and that worked.
We see that we moved the parameter with a position called named and moved that in front
of the positional parameter -logname and we see that the command ran
Sign up to access the rest of this lesson
You must either log in or sign up to access this lesson.

Saving Progress...