Windows PowerShell Scripting and Toolmaking

Learn how to improve administration of Windows server and client products

Course Code : 5079

Overview

This is an advanced level, instructor-led training, designed for IT professionals who are interested in developing their skills in Windows PowerShell and administrative automation. This course builds the foundation required to build tools for Windows PowerShell 5.0/5.1. With this course, participants will be able to master some of PowerShell’s more advanced uses. The course also covers how to integrate PowerShell with non-Microsoft products as well.

Schedule Classes

Looking for more sessions of this class?

Course Delivery

This course is available in the following formats:

Live Classroom
Duration: 5 days

Live Virtual Classroom
Duration: 5 days

What You'll learn

  • Describe the correct patterns for building modularized tools in Windows PowerShell
  • Build highly modularized functions that comply with native PowerShell patterns
  • Build controller scripts that expose user interfaces and automate business processes
  • Manage data in a variety of formats
  • Write automated tests for tools
  • Debug tools

Outline

  • Tools do one thing
  • Tools are flexible
  • Tools look native
  • Lab: Designing a Tool
    • Design a tool
  • Why start with a command?
  • Discovery and experimentation
  • Lab: Designing a Tool
    • Start with a command
  • Start with a basic function
  • Create a script module
  • Check prerequisites
  • Run the new command
  • Lab: Designing a Tool
    • Build a basic function and module
  • About CmdletBinding and common parameters
  • Accepting pipeline input
  • Mandatory-ness
  • Parameter validation
  • Parameter aliases
  • Lab: Designing a Tool
    • Adding CmdletBinding and Parameterizing
  • Assembling information
  • Constructing and emitting output
  • Quick tests
  • Lab: Designing a Tool
    • Emitting objects as output
  • Examining a script
  • Critiquing a script
  • Revising the script
  • Knowing the six channels
  • Adding verbose and warning output
  • Doing more with verbose output
  • Informational output
  • Lab: Designing a Tool
    • Using Verbose, Warning, and Informational Output
  • Where to put your help
  • Getting started
  • Going further with comment-based help
  • Broken help
  • Lab: Designing a Tool
    • Comment-based help
  • Understanding errors and exceptions
  • Bad handling
  • Two reasons for exception handling
  • Handling exceptions in our tool
  • Capturing the actual exception
  • Handling exceptions for non-commands
  • Going further with exception handling
  • Deprecated exception handling
  • Lab: Designing a Tool
    • Handling errors
  • Two kinds of bugs
  • The ultimate goal of debugging
  • Developing assumptions
  • Write-Debug
  • Set-PSBreakpoint
  • The PowerShell ISE
  • Lab: Designing a Tool
    • Basic debugging
  • Parameter positions
  • Validation
  • Multiple parameter sets
  • Value from remaining arguments
  • Help messages
  • Aliases
  • More CmdletBinding
  • External help
  • Using PlatyPs
  • Supporting online help
  • “About” topics
  • Making your help updatable
  • Lab: Designing a Tool
    • Writing full help
  • Sketching out the test
  • Making something to test
  • Expanding the test
  • Going further with Pester
  • Lab: Designing a Tool
    • Unit testing your code
  • Understanding types
  • The Extensible Type System
  • Extending an object
  • Using Update-TypeData
  • Performing a basic analysis
  • Analyzing the analysis
  • Lab: Designing a Tool
    • Analyzing your script
  • Begin with a manifest
  • Publishing to PowerShell Gallery
  • Publishing to private repositories
  • Lab: Designing a Tool
    • Publishing your tools
  • Building a menu
  • Using UIChoice
  • Writing a process controller
  • Lab: Designing a Tool
    • Basic controllers
  • A proxy example
  • Creating the proxy base
  • Modifying the proxy
  • Adding or removing parameters
  • Lab: Designing a Tool
    • Proxy functions
  • Simple: CliXML
  • Importing native XML
  • ConvertTo-XML
  • Creating native XML from scratch
  • Lab: Designing a Tool
    • Working with XML
  • Converting to JSON
  • Converting from JSON
  • Lab: Designing a Tool
    • Working with JSON data
  • SQL Server terminology and facts
  • Connecting to the server and database
  • Writing a query
  • Running a query
  • Invoke-SqlCmd
  • Thinking about tool design patterns
  • Lab problem
  • Break down the problem
  • Do the design
  • Test the commands
  • Code the tool
  • Lab: Final Exam
    • Lab one
  • Lab: Final Exam
    • Lab two
View More

Prerequisites

Participants must have experience at basic Windows administration, experience using Windows PowerShell to query and modify system information. They also need experience using Windows PowerShell to discover commands and their usage and experience using WMI and/or CIM to query system information.

Who Should Attend

This course is intended for administrators in a Microsoft-centric environment who want to build reusable units of automation, automate business processes, and enable less-technical colleagues to accomplish administrative tasks.

This course is highly recommended for:

  • System administrators
  • System engineers

Interested in this course? Let’s connect!

Customer Reviews

Name
Email
Rating
Comments

No reviews yet