Training

Questions about an Advanced PowerShell Class Design

Don Jones
3 min read
Share:

As we continue collecting responses to an outline survey about an Advanced PowerShell class, I’ve come up with a couple of questions and would appreciate any feedback you’d care to leave here.
Keep in mind that we’re a bit bound by this course being Microsoft Official Curriculum. I gotta make sure, in other words, that the average MCT can teach it. Ahem. I also have to face facts that people don’t read or obey course pre-requisite suggestions, and that a lot of people taking the course will have zero programming background.

Question 1: GUI

First, we desperately want to include some module on “building friendly GUI tools for techs and end-users.” It’s a massively demanded topic. That said, hand-coding a GUI in either WinForms or WPF is physically painful and time-consuming, and nobody would do it. Asking the class to use SAPIEN PowerShell Studio is probably not on the table; Microsoft has rules, these days, about third-party applications in classes, even if they’re free (which Studio isn’t). Using Visual Studio to generate WPF XAML is probably also out of the question - it adds a lot of build effort for just a single module.
So I’m down to a couple of options. Option A would be to provide students with a basic module that used PowerShell commands to construct a WinForms GUI. They would have after-class access to the module, too. After all, the big thing to teach here is less about how to physically build a GUI (if you were serious about it, you’d get PowerShell Studio), and more about the process of hooking up code to the GUI. By providing a module that shortcuts the hand-coding effort, we’d get to the important bit.
But there’s also a valid perspective that creating little distributable GUI tools is dumb, and that you should be building Web-based ones instead. We could certainly build a module around a simple ASPX page - which is much easier to hand-code with a few examples in front of you - that hosts the PowerShell engine to execute PowerShell commands. They’re centralized, great self-service tools, and easy to crank out once you’ve got a pattern to work from (which we’d provide in the class).
Thoughts?

Question 2: Workflow

We’d originally proposed a workflow overview module, with a basic example. Folks have quite rightly commented that workflow isn’t all it was hyped to be. It’s slow, in many cases. It’s hard. It isn’t really PowerShell. There aren’t a ton of killer examples that you can cover in the scope of a class.
But it offers parallelization, which is a great feature. So we’re considering replacing workflow with a module on parallelizing PowerShell. My thought is to do that mainly with jobs. Jobs work very consistently inside the shell, and are easy to use. They have some straightforward caveats, like the fact that they return serialized objects.
There’s an argument to be made for runspace pools, too. But those get very programmer-y. You have to start worrying about concurrency, thread safety, thread and pool management, and a lot more. I’m not sure, in the context of a PowerShell class, we can sufficiently cover all those extras so that someone could be safely effective with runspace pools. I get that they’re more flexible and low-level, but they’re a big topic, and nothing else in the course “leads up” to that level of .NET programming.
Thoughts?

Anything Else?

Any other suggestions aside from these two questions would be better served in the original survey. I’m not the only one evaluating those responses, and that survey is the only place we can guarantee the entire team will see everything.

Related Articles

Jun 7, 2020

Iron Scripter: Learn PowerShell through code challenges

Hello, friends! Today I want to talk about the Iron Scripter code challenges and the accompanying website. The challenges are excellent for practicing challenging concepts. What’s that you say? Not familiar with Iron Scripter? Let’s get you up to speed. Iron Scripter: A brief history lesson The Iron Scripter website is part of the PowerShell.org family and provides material for the Iron Scripter challenge that takes place at PowerShell Summit each year.

Aug 20, 2019

A Peculiar Parse

One of the best enhancements to Powershell was the inclusion of custom classes in v5. We originally wrote scripts, then we wrote cmdlets, followed by modules, and now we’ve graduated, with Class. I recently decided I wanted to write some code that would build a website. What better way to do that than by creating a class just for me? That’s rhetorical by the way. My early class code looked like this:

Jun 3, 2018

We Need Your Help.

We need your help.

As you may have heard, we’re launching a new “OnRamp” track at PowerShell + DevOps Global Summit 2019. Limited to 40 students, this will be a hands-on class designed to bootstrap someone into the technology and our community.  There’s a whole brochure about it!

We’re also offering a number of free-ride scholarships designed to cover admission, air, and hotel, to help increase the diversity of our field and community right at the top of the funnel. Half of our scholarships will be awarded to individuals from groups that are traditionally underrepresented in IT, and that’s where we need your help.

We need to get the word out to potential applicants so that they know to apply!