PowerShell Pop Quiz

I’m always looking for ways to help teach PowerShell and the other day I thought why not have PowerShell teach you itself? I have created a PowerShell script that dynamically generates a quiz on cmdlets and functions installed on your computer. In short the quiz question shows you a command synopsis and then presents a menu of possible answers. You select the answer. Given the verb-noun pattern of command names this *should* be easy, but you might be surprised.

Right now, the quiz comes in a stand-alone script. At some point I’ll most likely add it to my PSTeachingTools module which you can install from the PowerShell Gallery. The script has help so after you download it you can get it:

By default the script will find all cmdlets and functions from modules installed on your computer that have a properly defined synopsis. I’ve tried to include some filtering to handle buggy commands or those that have no help. You can also exclude one or more modules and wild cards are allowed. Or, you can specify a specific module. After the script builds a cache of commands it autogenerates a question and prompts you for an answer:


If you answer wrong, the script will display the correct answer. To continue with another question, press any key. The script will keep track of your progress and when you eventually quit, display a color coded summary result.


For now, you can find the script here.

I hope you’ll give it a shot and if you get errors, let me know. Also interested in any enhancements that would make this more useful. I have a few in mind already but I’d like to get some feedback on the core functionality.

2 thoughts on “PowerShell Pop Quiz

  1. I would love to see this where we could upload specific commands to go along with certain training to help students prep for exams or certifications, i.e. PowerShell commands specific to Windows 10 or Windows Server 2016 certs.

    I have not tried running it yet but, this looks great for quizzing on PowerShell in general.

Leave a Reply

Your email address will not be published. Required fields are marked *