Windows PowerShell: Scripting and Toolmaking

Paths

Windows PowerShell: Scripting and Toolmaking

Authors: Adam Bertram, Don Jones, Vlad Catrinescu, Josh Duffney , Jeff Hicks, Jeff Adkin, Robert Cain, Thomas Lee

With a solid foundation in PowerShell essentials, you’ll be able to move immediately into this path which covers the more advanced PowerShell topics of scripting and toolmaking.... Read more

What you will learn

  • Toolmaking fundamentals
  • Building advanced PowerShell functions and modules -Best practices for PowerShell usage
  • Reporting with PowerShell HTML
  • Debugging PowerShell in VS Code
  • Getting a grasp of PowerShell remoting fundamentals
  • Accessing SQL Server databases with PowerShell
  • Building PowerShell GUIs in WPF
  • Testing PowerShell with Pester
  • Utilizing Windows Workflows with PowerShell

Pre-requisites

A solid comprehension of core PowerShell features and techniques. Otherwise, viewing the Microsoft PowerShell Essentials path is recommended.

Beginner

These courses cover the fundamentals and best practices for PowerShell scripting and toolmaking.

PowerShell Toolmaking Fundamentals

by Adam Bertram

Sep 17, 2019 / 3h 55m

3h 55m

Start Course
Description

PowerShell can be many things to many different people. PowerShell can be a simple command-line replacement or a scripting language. Beginners to intermediate-level scripters are probably still writing one-liners and simple scripts. They're probably starting to see the potential of PowerShell not as a simple scripting language but as a way to build "tools" to use over and over again. Don't recreate the wheel. Learn how to create reusable scripts so you don't have to recreate that wheel.

Table of contents
  1. Introduction
  2. Moving from the Console to a Script
  3. Tool #1: Active Directory Account Management Automator
  4. Tool #2: Log Investigator
  5. Tool #3: File and Folder Management Automator
  6. Debugging Techniques
  7. Use Modules to Create a Tool Belt

Building Advanced PowerShell Functions and Modules

by Adam Bertram

Dec 23, 2015 / 4h 0m

4h 0m

Start Course
Description

In this course, we are going to cover nearly everything there is to know about advanced functions and modules. Overall, this course can be broken down into six main components: differences between basic and advanced functions, advanced functions and how to build them, leveraging the PowerShell pipeline in your advanced functions, how to build safeguards into your functions with WhatIf and Confirm support, building and managing script and manifest modules, and, finally, writing help content for both your advanced functions and modules.

Table of contents
  1. Building Advanced Functions
  2. Understanding Advanced Function Parameters
  3. Incorporating Advanced Pipeline Input
  4. Playing It Safe with WhatIf and Confirm
  5. Building and Managing Script Modules
  6. Building a Manifest Module
  7. Writing Help Content

Windows PowerShell Best Practices and Patterns

by Don Jones

Nov 10, 2014 / 2h 56m

2h 56m

Start Course
Description

Windows PowerShell MVP Don Jones helps you take your Windows PowerShell skills to a new, more professional level through the application of best practices and patterns. Developed and vetted by the overall PowerShell community, these patterns focus on maintainability, reliability, and conformance with native PowerShell approaches. Designed for administrators who are developing mission-critical and production-use PowerShell scripts, these patterns will help you - and your scripts - be taken more seriously.

Table of contents
  1. Introduction
  2. Providing Help
  3. Managing Version Compatibility
  4. Performance Practices
  5. Code Aesthetics
  6. Managing Output
  7. Script Design Patterns
  8. Pure PowerShell
  9. Handling Errors

Intermediate

These courses begin branching out into more advanced PowerShell topics including reporting with PowerShell HTML, debugging PowerShell in VS Code, remoting fundamentals, and accessing SQL Server databases from PowerShell.

Reporting with PowerShell HTML and Enhanced HTML

by Vlad Catrinescu

Jan 13, 2018 / 1h 19m

1h 19m

Start Course
Description

PowerShell is an awesome tool, and as an IT pro or a Developer you probably want to use its powerful automation potential to automate your own tasks. One of the most common tasks PowerShell is used for, is to create reports with information from all over the Microsoft ecosystem. In Reporting with PowerShell HTML and Enhanced HTML you will first learn what HTML files are, and why they are the best medium to display your reports. Next, you will explore how to use the out-of-the-box ConvertTo-HTML PowerShell cmdlet to export PowerShell objects to HTML. Finally, you will discover how to use the Enhanced HTML2 PowerShell module to create beautiful looking reports, with advanced features such as conditional formatting depending on values inside the PowerShell object. When you're finished with this course, you will have the skills and knowledge of PowerShell needed to create HTML reports in PowerShell.

Table of contents
  1. Course Overview
  2. Course Introduction
  3. Creating Reports with the ConvertTo-Html cmdlet
  4. Creating Reports with EnhancedHTML2
  5. Course Conclusion

Debugging PowerShell in VS Code

by Josh Duffney

Dec 6, 2017 / 1h 29m

1h 29m

Start Course
Description

Many people do not take the time required to become proficient at debugging. They believe it's not worth the time investment. What they don't realize is that mastering debugging actually saves them a lot more time than they would put in. In this course, Debugging PowerShell in VS Code, you'll learn the mental process behind debugging. First, you'll learn how to debug with Visual Studio Code. Next you'll be introduced to Pester, a testing framework for PowerShell. Finally, you'll discover how to take advantage of the advanced debugging features in Visual Studio Code such as watches, call stacks, and conditional breakpoints. After you've finished the course, you'll have the knowledge required to be a proficient debugger of PowerShell code.

Table of contents
  1. Course Overview
  2. Understanding Debugging
  3. Getting Started with the Debugger
  4. Debugging PowerShell Scripts, Functions, and Modules
  5. Debugging Pester Tests

PowerShell Remoting Fundamentals

by Jeff Hicks

Jan 7, 2016 / 4h 2m

4h 2m

Start Course
Description

This course is targeted for IT Pros and is intended to provide the viewer all the information they need to know to get started with PowerShell Remoting and how it can make their jobs easier. The goal is to provide coverage of fundamental PowerShell remoting concepts and practices that the majority of IT Pros are likely to use in their day to day work including topics like TrustedHosts, SSL connections, and Disconnected Sessions. The course is designed to follow a typical Windows administrator, Stephanie, who wants to learn how to use PowerShell remoting to do her job more efficiently. You will shadow her progress as she learns how to set up and use PowerShell remoting. Live demonstrations will depict her learning experiences, including likely mistakes. The goal is for you to put yourself into Stephanie's place and learn as she does. This course assumes the user has some basic PowerShell skills and experience and is looking to take advantage of PowerShell remoting in their day to day work.

Table of contents
  1. Course Introduction
  2. Introduction and Lab Setup
  3. Remoting Concepts and Terminology
  4. Setting up PowerShell Remoting
  5. One to One Remoting
  6. One to Many Remoting
  7. Configuring PowerShell Remoting with SSL
  8. PowerShell Remoting Security
  9. Implicit Remoting
  10. Disconnected Sessions
  11. Troubleshooting PowerShell Remoting
  12. PowerShell Remoting: Next Steps

Accessing SQL Server Databases from PowerShell

by Vlad Catrinescu

Oct 4, 2017 / 56m

56m

Start Course
Description

PowerShell is an awesome tool, and as an IT pro or a Developer you probably want to use its powerful automation potential to automate your own tasks. SQL Server is the database software of choice for organizations running in the Microsoft ecosystem. Instead of storing information from your PowerShell scripts in CSV or text files, you can store this information into a SQL Database and then use SQL Server's powerful reporting tools to create beautiful looking reports and historical data. In this course, Accessing SQL Server Databases from PowerShell, you'll learn how to use PowerShell to read and write data from/to a SQL Server database. First, you'll discover how to get the required PowerShell Module and how to connect to both a local and a remote SQL Server. Next, you'll explore how to use PowerShell to read data from a SQL Table. Finally, you'll learn how to use PowerShell to write information to an existing, or a brand-new SQL database. When you're finished with this course, you'll have the skills and knowledge of PowerShell needed to access SQL Server databases from PowerShell.

Table of contents
  1. Course Overview
  2. Course Introduction
  3. Connecting to SQL Server
  4. Reading Data from a SQL Database
  5. Writing Information into a SQL Database
  6. Course Conclusion

Advanced

These courses finish off the path by offering you advanced uses and integrations for PowerShell. This will include crossover courses featuring WPF and Pester.

Building PowerShell GUIs in WPF for Free

by Jeff Adkin

Sep 23, 2016 / 2h 22m

2h 22m

Start Course
Description

At the core of creating PowerShell UIs is a thorough knowledge of Windows Presentation Framework. In this course, Building PowerShell GUIs in WPF for Free, you will learn how to create UIs for your PowerShell scripts. You will first learn how to create WPF XAML and import that into PowerShell. Then, you'll learn about the controls and spending some time working with them. Finally, you'll learn how to create executable PowerShell scripts with UIs for redistribution. When you're finished with this course, you will have a foundational knowledge of creating UIs in WPF for PowerShell that will help you as you move forward to creating your own UIs for your PowerShell scripts.

Table of contents
  1. Course Overview
  2. Understanding Basic WPF UI
  3. Working with WPF Controls
  4. Creating an Event Viewer
  5. Creating a GUI in XAML Using Visual Studio
  6. Creating a Full Executable Program

Testing PowerShell with Pester

by Robert Cain

Jun 17, 2016 / 4h 11m

4h 11m

Start Course
Description

Having a good testing framework will ensure your PowerShell scripts function as designed, and will ensure they continue to work correctly after you make changes. In this course, Testing PowerShell with Pester, you'll learn how to use Pester, the new open source testing tool, to create tests for all of your PowerShell scripts and modules. You'll start with seeing how to use Pester to test an existing code base. After that, Pester will be used to validate change requests to a module. Finally, you'll use Pester along with Test Driven Development to craft a brand new module. After watching this course, you'll have the confidence to test and use your own PowerShell scripts in your own projects.

Table of contents
  1. Introduction to Unit Testing
  2. Implementing Your First Pester Tests
  3. Basic Function Testing with Pester
  4. Growing Your Pester Skills Advanced Function Testing
  5. Verifying Changes to Existing Scripts with Pester Tests
  6. Creating New Scripts with Test Driven Development, Part 1
  7. Creating New Scripts with Test Driven Development, Part 2

Infrastructure Testing with Pester

by Adam Bertram

Jan 5, 2017 / 2h 53m

2h 53m

Start Course
Description

Writing a small script, waiting to see if it errors out and then eyeballing the results are common. But are you sure that script you created actually did everything you intended? It's important to understand just because a script doesn't output an error and your manual eyeballing sees no problems doesn't actually mean there isn't one. In this course, Infrastructure Testing with Pester, you'll go from guessing the infrastructure changes that you made to seeing if they did actually change. First, you'll discover how to write the right tests. Next, you'll explore the infrastructure dependencies. Finally, you'll learn how to build a web dashboard. By the end of this course, you'll have a better understanding on infrastructure testing with Pester.

Table of contents
  1. Course Overview
  2. Introduction to Testing and Pester
  3. Implementing Your First Infrastructure Test with Pester
  4. Validating Infrastructure Changes in Pester
  5. Working with Dependencies
  6. Building a Testing Report Dashboard

Windows Workflows with PowerShell

by Thomas Lee

Aug 2, 2016 / 2h 31m

2h 31m

Start Course
Description

Workflows are used to execute long-running and restartable scripts that are a bother to run individually--they can greatly increase your productivity. This course, Windows Workflows with PowerShell, you'll learn how to use PowerShell workflows to help you do your work more efficiently. You'll first begin by learning about different workflows and how to write and run them with Windows PowerShell. Next, you'll look at some of the issues that might arise when you convert a script or set of scripts into a workflow. Finally, you'll learn how to convert a set of scripts to a workflow. By the end of this course, you'll have the resources to understand Windows workflows with PowerShell and you'll be able to work faster then ever.

Table of contents
  1. Course Overview
  2. An Overview to Workflows and PowerShell
  3. Building Workflows Using PowerShell
  4. Running PowerShell Workflows
  5. Progressing from Function to Workflow
  6. Troubleshooting Workflows

Working with CSV Data in PowerShell

by Vlad Catrinescu

May 26, 2017 / 51m

51m

Start Course
Description

PowerShell is an awesome tool, and as an IT pro you probably want to use its powerful automation potential to automate your own tasks. To efficiently automate processes, you will need to use input files, because it's not really automation if you need to give it a manual input for every single process you want to run. In this course, Working with CSV Data in PowerShell, you will learn how to work with CSV files in your PowerShell scripts. First, you will learn what CSV files are, and why/when you should use them. Next, you'll learn how to get information with PowerShell and output it to a CSV file. Finally, you'll learn how to use CSV files as input files for your PowerShell scripts. When you're finished with this course, you will have the skills and knowledge of PowerShell needed to work with CSV data in PowerShell.

Table of contents
  1. Course Overview
  2. Introduction to CSV
  3. Exporting Information to CSV
  4. Importing Information from CSV
  5. Course Conclusion

Working with XML Data in PowerShell

by Vlad Catrinescu

Sep 8, 2017 / 1h 8m

1h 8m

Start Course
Description

PowerShell is an awesome tool, and as an IT pro or a Developper you probably want to use its powerful automation potential to automate your own tasks. To efficiently automate processes, you'll need to use input files, because it's not really automation if you need to give it a manual input for every single process you want to run. In this course, Working with XML Data in PowerShell, you'll learn how to work with XML files in your PowerShell scripts. First, you'll discover what XML files are, their synthax, and why/when you should use them. Next, you'll explore how to get information with PowerShell and output it to a XML file. Finally, you'll learn how to use XML files as input files for your PowerShell scripts. When you're finished with this course, you'll have the skills and knowledge of PowerShell needed to work with XML data in PowerShell.

Table of contents
  1. Course Overview
  2. Introduction
  3. Exporting Information to XML
  4. Importing Information from XML
  5. Course Conclusion