- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Core Tech

Build a PowerShell Tool for Windows Event and Text Log Analysis
In this lab, you’ll practice building a PowerShell tool to analyze Windows event logs and text files. When you’re finished, you’ll have a functioning script to scan activity in a given timeframe.

Lab Info
Table of Contents
-
Challenge
Getting Started in the Lab Environment
Here are the initial instructions and explanation of the lab environment. Read this while your environment is busy creating itself from nothing. Yes, this violates physics; we know. How fun!
-
Challenge
Brainstorm and Sketch Out a Tool
You will start to create a PowerShell script to audit a server.
-
Challenge
Use Get-WinEvent to Query Window Event Logs
Explore the full event logs, and then gradually apply filters to retrieve specific logs, understanding why filtering is crucial.
-
Challenge
Find Local Storage Volumes
Learn how to filter local drives by root paths, and search recursively for specific file types within those drives.
-
Challenge
Search all Local Storage Volumes for Log Files
Using Get-ChildItem, learn how to interrogate text log files on your local storage volumes.
-
Challenge
Add Script Parameters
Make the tool more dynamic by creating a holistic script that runs together with parameters.
-
Challenge
Add CSV Output
In this challenge, you will learn to export the records found into a CSV file, rather than just outputting them via the console. Saving to a CSV file will allow you to quickly parse and share the results of your script with others.
-
Challenge
Add Simple Error Handling
In this final challenge, you will learn to incorporate basic error handling into your tool. You’ll learn about the $Error variable, non-terminating and terminating errors.
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.