r/PowerShell • • May 21 '17

OP PowerShell Training Course

Hey all,

So about 10 months back I asked for some help around creating a basic PowerShell training course for fellow engineers in an MSP. Most peeps there haven't taken the time to learn scripting by themselves, so the course had to break it down simply and teach them from the ground up.

Well... Thanks to all of your support, I've finally created the course! I've ran two training sessions so far, both lasting roughly 3 hours, and it seems to work!

I've had one engineer for whom it did just not click. I got to comparison operators and his brain just farted. As a teacher it felt awful not being able to make it click for it, but it has worked for about 30 other engineers.

I thought i'd post a link to the training here as a thank you to everyone who helped. It's on GitHub at the below URL:

https://github.com/Sudoblark/Powershell_Intro_Training.git

Happy scripting all!

106 Upvotes

20 comments sorted by

View all comments

3

u/wonkifier May 21 '17

The place my folks ended up running into the most trouble was with loops.

They could describe them, if you gave them a simple one they could generally tell you what would happen, but they just could not build one on their own.

For something as simple as:

foreach ($user in $users) 
{
  write-output "working on $user"
  dosomething $user
}

They'd invariably write out

foreach ($user in $users) 
{
  write-output "working on $user"
}
dosomething $user

And wonder why the thing wasn't happening to all the users. There was just some sort of mental block we could never get through

2

u/Dogezon May 21 '17

Yeah my guys struggled with that at first. Once they got the concept of objects, arrays and enumeration they were alright.

I found that it helped to draw everything out on a whiteboard and visualise the enumeration process.

So I'd draw, for example, 5 bananas on a white board. A circle around of them to define the array and a square for my block of code. Then I’d be like “OK so this loop takes each banana out the array, applies this code, puts it back and then moves on to the next banana.” They struggled with what the first variable means so we named it a few things, like BigHairyBalls and ChocolateCake, to hit home the fact that it’s just the name given for each object.

Once you get past that mental block everything hits home! It’s just getting past it that’s tough.

1

u/[deleted] May 22 '17

BigHairyBalls and ChocolateCake, to hit home the fact that it’s just the name given for each object.

This was a major headache for me learning to code about 10 years ago. IT was horribly confusing the first time I encountered classes and they used the lower case name of the class for the instantiated object.

1

u/Dogezon May 23 '17

It's just one of those things that needs to click. I tend to find that if I'm enumerating through arrays then the array will be plural and the enumeration object singular. Probably a bad habit but it's clear and concise.

Classes are confusing to get your head round at first, I tend to use kettles as an example. Each kettle may have a custom paint job or something (instances) but the main things that make a kettle a Kettle (class) don't change. They all have a method for boiling water! Tried to use planes once but the guy was former RAF and started pointing out different plane specs 😂 Wasn't about to talk about parent classes etc so quickly skipped that.