I started learning PowerShell at work a few weeks ago. Since I have trouble staying motivated by abstract exercises, my colleagues gave me practical tasks that could be useful in the future, and I've now completed them. I'm looking for a website or collection of exercises that shows me PowerShell code and asks me to explain what it does. Are there any good resources for practicing this kind of code comprehension?
4 Answers
Codecademy has a beginner-friendly PowerShell course, and Exercism also offers a PowerShell track. Exercism is more focused on traditional programming exercises than workplace scripting, but it’s still useful for practicing syntax, logic, and problem solving.
ShellReps and the PowerShell articles on Adam the Automator are also worth checking out. They include examples ranging from beginner topics to more advanced automation, so you can read a script and try to predict what each part does before running it.
Take a look at the PSKoans module. It teaches PowerShell through test-based exercises, where you fix or complete each challenge before moving on. You can find it with `Find-PSResource -Type Module -Name PSKoans`. That said, once you understand the basics, using real work tasks is usually the most effective approach. Break a task into small steps, then figure out how to automate each one.
You could make your own practice routine by choosing one manual task each week and automating it. For example, a password reset workflow could involve finding a user, creating a secure password string, and applying it to the account. Using an AI assistant can help generate examples too, but make sure you test and verify everything yourself. Understanding why the code works is more valuable than simply getting a working script.

That makes sense. Most of the existing tasks at work are already scripted, so I’m looking for exercises that help me understand different approaches instead of just rewriting the same scripts.