Advanced PowerShell
Learn On Demand
Learn On Demand Pro Series

Time
1 hour
Difficulty
Beginner

This “Getting Started with Advanced PowerShell” IT Pro Challenge virtual lab teaches learners to create powerful scripts and a module, needed to administrate network servers while learning debugging techniques. This lab will teach learners the knowledge used in the Exploitation Analyst role, Cyber Operator role, and most IT technology paths.

Become one of the 3 million IT and Cyber professionals advancing their careers

Sign up with
Or

Already have an account? Sign In »

Overview

Create Windows® PowerShell® scripts, modules, and workflows in an Integrated Scripting Environment (ISE). Also, generate an HTML report, use a breakpoint to debug a script, and configure a server by using PowerShell Desired State Configuration.

Learners need an installation of Microsoft Remote Desktop, used to configure a Microsoft® Azure® virtual machine for the lab exercises, and some familiarity with PowerShell. From there, learners complete the Advanced Automated Administration PowerShell - Challenge Series, a one-hour guided IT Pro Challenge virtual lab.

Create A PowerShell Script

Create a PowerShell script that displays disk drive partition information. Utilize advantages from the Windows PowerShell Integrated Scripting Environment (ISE):

  • Tab-completion
  • Parameter options
  • Syntax checking
  • A cmdlet Library

Create a PowerShell Module

Create a PowerShell module, a set of portable cmdlets with all supporting functionality, and a descriptive manifest to display network information. This module can import to multiple Windows hosts.

Create a Menu by Using PowerShell

Create a menu-driven PowerShell script to display network settings, by assigning to a variable named $Choice to a selection of menu items. Continue to modify the script to create three new menu items and test the menu code.

See how a menu provides users with different selections, making a script more user-friendly and easier to understand. The script’s switch statement runs a Get-NetAdapter command or exits the menu based on what the user chooses.

Create an HTML report

Create a simple HTML document to display service information. Learners write a script that exports results to an HTML file, a convenient format for creating configuration documentation, archiving, and reporting.

Work with XML Documents

Create two local user accounts by using a PowerShell script and the eXtensible Markup Language (XML) PowerShell, a standard file format to handle content across multiple operating systems.

Create a Custom Error Message and Use Breakpoints

After creating a buggy code, learners generate a log file with a custom error message to provide clarity. Then learners use breakpoints to analyze and debug a script with mistakes by stepping through the script execution, at specified points, and making fixes as needed. Breakpoints can be set when calling a variable, running a command, or on a defined line number.

Manage Server Configurations by Using PowerShell

Learners use the PowerShell Desired State Configuration (DSC) and a PowerShell workflow to manage server configurations. Learners get hands-on experience with DSC to declare and distribute a specific configuration across one or more systems. DSC defines and changes configurations in one place instead of updating each machine individually.

Implement a PowerShell Workflow

This hands-on lab displays information about server configurations using a workflow. PowerShell workflows give administrators the ability to create and run multiple commands across local and remote machines, from a script, in parallel. The PowerShell workflow can repeat and be interrupted and then restarted. This hands-on lab shows learners how to customize the workflow to run in sequence or parallel and to which computer/s. This lab highlights how such a workflow could be run simultaneously against hundreds of computers in parallel.

Summary:

Upon completing the “Getting Started with Advanced PowerShell” virtual lab, learners have PowerShell scripting, module, debugging and workflow basics. In addition, they have used cmdlets needed to administer servers and have the basics to generate logs and continue customizing code.