PowerShell Scripting

HH9510 : 5 Day Instructor-Led Workshop

5 Days of PowerShell Scripting for System Administrators

Audience:
Students attending this course are responsible for implementing, configuring, and administering Networks.

Prerequisites:
 

 

Course Outline:
 

Module 1 Introduction to Interface TT

Module 2 Introducing PowerShell and the IDE
 

  • Welcome To The Gang
  • The Basics
  • What Is PowerShell
  • Installation
  • Starting PowerShell
  • PowerShell Commands
  • Cmdlets
  • Shell Function Commands
  • Script Commands
  • Native Commands
  • Enhancing Aliased Commands From Cmd.exe To Allow For All Switches
  • PowerShell Snap-ins
  • Exchange 2007
  • SCOM
  • Navigating in PowerShell
  • Drives
  • PowerShell Drives
  • File System
  • Registry
  • HKLM and HKCU
  • Get-psdrive
  • Set-location
  • Push-location
  • Pop-location
  • Aliases, Functions
  • Create your own
  • Disabling Aliases
  • Parameters
  • Ubiquitous Parameters
  • Positional Parameters
  • Help
  • Variables
  • Built-in
  • Create your own
  • Using with Aliases
  • Profiles
  • Four built in Profiles
  • Customizing Profiles
  • LAB
  • Explore the Help Environment
  • Use Cmdlets
  • Create Custom Profile
  • Work With Registry Data

 

Module 3 Introducing the .NET Framework.
 

  • Overview of the .NET Framework
  • What it is.
  • What it does.
  • How it works with PowerShell
  • The .NET Class Library
  • The Common Language Runtime
  • MSIL Language
  • Versions
  • Object – based vs. Object Oriented
  • Strongly Typing
  • Custom Data Types
  • Overview Of The PowerShell Related NameSpaces and Their Members
  • System.Management.Automation
  • System.Management.Automation.Provider
  • Microsoft.PowerShell.Commands
  • System.Management.Automation.Host
  • System.Management.Automation.Internal
  • CmdletMetadataAttribute class
  • CmdletAttribute class
  • System.Management.Automation.Runspaces
  • .NET Objects
  • Properties
  • Methods
  • Inheritance
  • LAB (Running commandlets to retrieve specific information about the .NET namespaces and members. Writing a script to determine the version of the .NET framework installed on the machine. Upgrading the version of the .NET Framework)

 

Module 4 Basic Programming Syntax with PowerShell
 

  • Curly Braces
  • Variables
  • Parenthesis
  • Foreach syntax
  • While syntax
  • Case syntax
  • Collection syntax
  • Write-Host
  • Read-Host
  • Classes
  • Lists<T>
  • Tab based object browsing
  • Exploring the Pipeline
  • Verb-Noun Syntax
  • LAB (trying it all out)
  • Declare A Person Class
  • Write Script to Gather Information
  • Add Folks To List
  • Loop Through List
  • Display List Of Folks

 

Module 5 The Command Line
 

  • Getting Down Without The IDE
  • Grouping Commanlets
  • Customizing The PowerShell Command Window
  • Customizing The PowerShell Profile
  • Gathering Data About The Machine
  • WMI Calls
  • Storing in Variables
  • Get-Set Properties On System Objects
  • Adjusting Attributes
  • LAB
  • Using PowerShell Command Window Customize Look and Feel
  • Create a Profile
  • Gather System Information and Get and Set Properities

 

Module 6 Commandlets
 

  • Overview of Commandlets
  • Built In Commandlets
  • Aliases
  • Creating Custom Aliases
  • Under Neath The Covers
  • Custom Commandlets
  • LAB
  • Utilizing built in Commandlets Create and Configure and Activate DHCP
  • Set TCP/IP Properties
  • Create Custom Commandlets

 

Module 7 Object Based Scripting
 

  • Planning
  • Use Cases
  • Algorithms
  • Properties and Methods
  • Classes
  • Creating Custom Classes
  • PowerShell Providers
  • Creating Custom Providers
  • Creating Windows PowerShell Hosting Applications
  • LAB
  • Create a Custom PowerShell Hosting Application to Deploy to machines to gather User Information.

 

Module 8 Syntax, Special Characters, Operators, Regular Expressions, I/O , XML and HTML
 

  • Quotes
  • Redirecting Output
  • Command Continuation
  • Special Characters
  • Operator Precedence
  • Operators Galore
  • System.IO
  • System.Text
  • System.String
  • Regular Expressions 101
  • Pattern Matching
  • XML 101
  • Writing to XML
  • Reading From XML
  • Formatting XML
  • Importing CSV and Converting To XML
  • HTML
  • OutPutting To HTML
  • LAB (Working with all of the above)
  • Write Script To Get Results
  • Parse Results
  • Find Matches of Result Set and CSV File
  • Output To XML File
  • OutPut To HTML File

 

Module 9 Collections
 

  • Overview of Collections
  • Arrays, Hashes, Generic Lists
  • Collection Commands
  • Collection of Objects
  • WMI
  • Collection of Phrases
  • Count Property
  • Filtering Collections
  • LAB (Assemble a Collection of Data from various sources, parse it and put it into a series of logfiles.)

 

Module 10 Looping
 

  • Parsing Data In Collections
  • Where
  • While
  • ForEach
  • Switch
  • If
  • LAB (Parse the Log files from the previous lab)

 

Module 11 Functions and The PipeLine
 

  • Creating Custom Functions
  • The PipeLine
  • Passing Data
  • DeBugging
  • What-if
  • LAB
  • Create custom functions to gather WMI Data and pass it to functions to display web pages as data changes pages refresh.

 

Module 12 Writing Scripts
 

  • Getting Down and Dirty and Coding
  • Putting It all Together
  • Planning
  • Testing
  • Script Center
  • Script Control object
  • Script Property
  • Running from cmd.exe
  • Exit code
  • LAB
  • Write 20 Scripts
  • Link 5 of them as application

 

Module 13 Security
 

  • Reality Check Time
  • Introduction to Security for Power Shell
  • Input Validation
  • Securing the Development Environment
  • Managing the Command Path
  • Execution Policy
  • Signing Scripts
  • Creating A Self – Signed Certificate
  • Using a Certificate To Sign A Script
  • SecureString
  • Credentials
  • Common Sense
  • Reminder that this is not a Security Class.
  • LAB (Students will create a self signed certificate and then sign a script with it.)

 

Module 14 Application Specific Functionality
 

  • SharePoint
  • Exchange 2007
  • SMS
  • Active Directory

 

LAB (Students are given 5 tasks for each product and have a choice to do any number or combination of those as a final project.)