How to use PowerShell as a learning tool

- select the contributor at the end of the page -

When someone brings up PowerShell, you likely conjure up images of different types of automation you can accomplish with it. Maybe you think about managing software products like Microsoft Exchange or Windows server. Maybe you only think of PowerShell as a cmd.exe replacement. Either way, have you ever considered how PowerShell could be a learning tool for these technologies? Not how to automate them, but to actually learn how they work? Let's do a quick rundown of how you can start using PowerShell in this way.

PowerShell as a discovery tool


PowerShell can be a wonderful discovery tool. Its intuitive nature allows anyone to simply issue a Get cmdlet followed by some noun to find out more about it. If we could use PowerShell in the physical world, you might find a Get-CarEngine cmdlet. This cmdlet would then return all properties of that car’s engine like water pump, crankshaft, intake manifold, etc. Wouldn’t that be cool? Perhaps one of these days someone can create Ford, Chevrolet or BMW modules that interface with Internet-connected cars!

Anyway, you get the point. Having a discovery tool like PowerShell allows a curious learner to tinker; to poke and prod at a topic. PowerShell allows you to explore various properties and attributes of the different kind of objects that make up whatever technology you’re working with.

Getting started


To start using PowerShell as a learning tool, you first need to know how to – surprise – use PowerShell. If you’re just getting started, I highly encourage you to check out some of the Pluralsight courses on PowerShell. For argument’s sake, let’s say that you already know how to use PowerShell. You know enough of the concepts behind it and know the language well. One day your boss comes to you and drops Active Directory on your lap. “Congratulations,” he says. “You are now our AD guy.” Sound familiar? You’ve just earned another hat to wear. Where do you turn to learn more about AD? Other than Pluralsight courses (of course!), applying PowerShell to AD would be another great way to learn AD.

Running commands


Maybe you want to learn about the different kinds of objects in AD. You could simply run Get-AdUser -Filter * -Property * | select -first 1 and it would return a single user object from the domain and all of its properties. You then might notice the distinguished name which contains an organizational unit the user is in. “Hmm..what’s the organizational unit?” you ask. Intuitively, you type Get-AdOrganizationalUnit and discover all of its properties.

You might also see that one of the properties of a user is the "memberOf" property. You want to know what that is, so you conduct a quick Internet search, which reveals that this user is a member of a few groups. But wait, what’s a group? Get-AdGroup and you'll know. The relationship between a user and a group can be one too many, as well, since that user is a member of multiple groups.

Using PowerShell allows you to learn a technology in an object-oriented fashion. When you run these commands you are creating an object model in your head of how each of these objects fit together. You are able to connect which objects relate to others, any dependencies that may exist, mappings like 1:1 or 1:many and so on. Using a discovery tool like PowerShell allows you to answer all those questions that often arise.

Many IT people learn in this manner, and maybe that’s because we can’t learn from a textbook in a linear fashion. Instead, we learn by diving into the deep end of the pool, which forces us to instinctively figure out how all the pieces fit together. When learning this way, you need a method for quickly discovering objects and attributes. The intuitive nature of PowerShell allows you to think of what a command is -- and you’re usually right!

The next time you want to learn a new technology I encourage you to give PowerShell a try.

Get our content first. In your inbox.

Loading form...

If this message remains, it may be due to cookies being disabled or to an ad blocker.

Contributor

Adam Bertram

is an independent consultant, technical writer, trainer and presenter. Adam specializes in consulting and evangelizing all things IT automation mainly focused around Windows PowerShell. Adam is a Microsoft Windows PowerShell MVP, 2015 powershell.org PowerShell hero and has numerous Microsoft IT pro certifications. He is a writer, trainer and presenter and authors IT pro course content for Pluralsight. He is also a regular contributor to numerous print and online publications and presents at various user groups and conferences. You can find Adam at his site listed below or on Twitter at @adbertram.