Episode 005: Automation with PowerShell

Mike Pfeiffer on January, 29, 2019

In this episode, I talk to Jeff Hicks about automation with PowerShell. Jeff is the author of numerous PowerShell books, and he’s a well known Pluralsight Author and Microsoft MVP. He recently published a book called “The PowerShell Practice Primer,” and we get his thoughts on working with PowerShell in this episode.

Here are the resources mentioned on the show:

Jeffery Hicks is an IT veteran with over 25 years of experience, much of it spent as an IT infrastructure consultant specializing in Microsoft server technologies with an emphasis in automation and efficiency. He is a multi-year recipient of the Microsoft MVP Award. He works today as an independent author, teacher, and consultant. He has been creating Pluralsight content for over 10 years. Jeff has written for numerous online sites and print publications, is a contributing editor at Petri.com, and speaks frequently at technology conferences and user groups. His latest book with Don Jones is "The PowerShell Scripting and Toolmaking Book" http://bit.ly/PSToolmaking

Full Transcript:

Mike Pfeiffer:
Hey, what’s up everybody? It’s Mike Pfeiffer. Today is January 29th, 2019 and this is episode number five of CloudSkills FM. In this episode, I got something awesome for you guys. We’re going to be talking about automation with PowerShell.

Mike Pfeiffer:
All right guys, welcome to episode number five. In this episode I’m talking to PowerShell MVP, Jeff Hicks. He’s a guy that has been in the IT industry for a really long time. He’s somebody that’s written a ton of PowerShell books and has done quite a bit over the last decade when it comes to training folks, building content around PowerShell, building scripts and solutions, and he’s a guy that is basically an expert when it comes to automating pretty much anything you can think of in the Windows platform.

Mike Pfeiffer:
Now, as we all know in Azure, there’s tons of integration with PowerShell. There’s even integration with PowerShell in other platforms as well. If you look at AWS, they’ve got their own command lets and things like that. So if you’ve got PowerShell skills now and you want to bring those into the cloud, I think you’re really going to enjoy this episode, and I also think if you’re in a window shop and you’re somebody that is even just starting to learn PowerShell, this is something that you want to pay close attention to, because you can start building these skills now and then again, you can leverage them in more than one cloud platform in the future.

Mike Pfeiffer:
Really important to make sure that you’re focusing on automation. Doesn’t matter whether you’re an infrastructure person, a developer. When it comes to working in the cloud, writing scripts, doing infrastructure’s code and automating things, speed and agility is basically super important in this new world, so I’m excited to get you into the episode. We can talk to Jeff and get some of his perspectives when it comes to automating with PowerShell.

Mike Pfeiffer:
All right, everybody, welcome to this episode of CloudSkills FM. I’m super excited to have you guys here today because I have a legendary PowerShell influencer on the show. It is Microsoft MVP and someone that’s really inspired me and taught me a lot over the years. It’s Jeff Hicks. Jeff, welcome to the show.

Jeff Hicks:
Hey Mike. Thanks for having me. Good to see you again.

Mike Pfeiffer:
Yes, it’s good to see you and like I was saying man, I’m really excited to have you on because I’ve been following you since the old days, way back when you were working for SAPIEN as… What did they call you back then? A scripting God, or something?

Jeff Hicks:
Scripting gurus, or something like that. Yes, some funny title they came up with.

Mike Pfeiffer:
Yes, man. I remember you from those days, the early PowerShell days, even some of your VBScript stuff and then had the privilege to get to know you over the years on the conference circuit and just watch what you’ve done with PowerShell over the last 10 years, or whatever it’s been. It’s been pretty amazing and there’s tons of stuff out there. You’ve got books, Pluralsight videos on PowerShell. So I’m curious, what are you working on these days?

Jeff Hicks:
Well, these days I’m still doing live classes for companies, so I’m gearing up on that. I’m always working on some new project that usually ends up on GitHub, namely the PowerShell gallery. Most of my book writing now is on Leanpub, So the recent book that I did was the PowerShell practice primer, which is a hundred exercises geared towards beginners who say, “You know what? I’ve learned PowerShell but I don’t know what to do with it?” So I’ve given them a hundred exercises and they’re really simple. There’s no scripting. It’s just one or two lines of commands that you type with the console and in the process of solving those or answering those questions, that’s how you learn PowerShell, because really, as you’ve said in other episodes, you’ve got to do, right?

Mike Pfeiffer:
Right.

Jeff Hicks:
You can’t just read or think about it, you have to get your hands dirty, and so I wrote this book thinking, "Okay, here’s a way. Let me give someone the ability to say, “Okay, give me a problem and let me figure it out,” and that’s how I think you can really learn. So a lot of my emphasis these days is still in the education space and teaching PowerShell, now even though PowerShell has been out for over 10 years, we’re now version 6.1.2, or something like that, there are still people, even though they’ve been in the industry for 10 years, who are deciding, “Maybe I better learn this PowerShell thing.”

Mike Pfeiffer:
Yes.

Jeff Hicks:
There’s still a growing, ever-growing audience for PowerShell fundamentals, which is amazing. I’m glad, because it helps pay the mortgage and put dog food in my dog’s dish and take my daughter to the movies, all those things, but yes, there are still people who are wanting to learn PowerShell, which is a good thing.

Mike Pfeiffer:
Yes, it is, and I’ve been fascinated by that too, because when I was really big into PowerShell… I still use it quite a bit, but, I don’t know, eight years ago I was really deep into it, back in the day when we were running PowerShell user group here in Phoenix and I was writing exchange server related scripting books with PowerShell, back then it was this huge transition. People were going from point and click administration to doing scripting and automation, but to look at the current status, it’s still growing and just to your point, tons of people are still realizing, “Hmm, this is the next step for me going into this new world where things change every single day and automation is super important, more important than ever.”

Mike Pfeiffer:
In your teaching and working with people and helping people ramp up still in these days, I’m sure you’re getting a lot of interests from people that are focused in the cloud. Obviously Azure is huge in the Microsoft space, but we’re seeing PowerShell pop up in other places as well that we’ll talk about here in this episode, but I’m curious, what are the people that you’re working with using PowerShell for in the cloud?

Jeff Hicks:
Certainly a lot of Azure stuff. Azure is always really big. I don’t see as much AWS with people who cross my path. Some O 365 stuff, SharePoint, a fair bit of SeekWell stuff, even though that’s not necessarily cloud things, but people wanting to learn how to use PowerShell to solve some problem, and one of the things that always concerns me and something I’m going to try to focus on even more this year, it’s been jelling in my head the last few months, and especially listening to your podcast it’s begun, it’s really crystallized some things for me, because I’ve spent 10 plus years still focusing on PowerShell fundamentals, because that’s what people are still asking for and to be honest, a lot of the cloud stuff I’ve never really had to dive into, because I’ve never had a need for it.

Jeff Hicks:
I work for myself, I work at home, I don’t have an enterprise where I have to stand up a big cloud infrastructure. That said, I need to learn cloud and containers, because that’s what my customers and my readers and who people view my courses are looking for, but what I want to get people to think about is, and let’s talk about say Azure. Now learning the Azure concepts, that’s one thing, right? You have to understand about resource groups and how Azure works conceptually. Now there are a whole set of PowerShell commands that you can use to manage Azure, or PowerCLI to manage VMware, or Hyper-V hyper and the Hyper-V commandlets. So what I don’t want people to do, and I see this in the Facebook PowerShell group and in people on Twitter and other things, is they get hung up on saying, “Okay, how do I use, say, the new ADUser command to create a new active directory user account?”

Jeff Hicks:
What they want is just basically training to say, “How do I use this command? How do you use this command to find the users in a group?” And I get that. They have a a pain point they’re trying to solve and they’re trying to look at PowerShell as the solution for that, but what I’m afraid of is they’re looking for what I refer to as training. Now, even though I’ve been doing classroom teaching and conferences for a long time, I no longer refer to myself as a trainer. I refer to myself as a teacher, because to me training implies, click this, type this to get this desired result. Way back in the day, I remember going to a training class to install Windows NT server.

Mike Pfeiffer:
[crosstalk 00:08:18] [inaudible 00:08:18].

Jeff Hicks:
And it was a training class, because you had to follow a particular set of steps in order to install the server and if you didn’t follow those steps it was not going to get installed, and what I don’t want people to do, and I tell people this in my classes is, I’m not going to train you how to type something in PowerShell. I don’t want to train you how to use new active directory… New ADUser. Instead what you should focus on is take a step back, focus on the fundamentals of PowerShell. Understand commandlets. The pipeline. How to find help. How to discover things. What can I do with PowerShell? How does it work? Because once you understand the concepts, learning then, the commandlet to create a new active directory user count is no big deal. I need to take a thousand user counts in a CSV file and pipe them in and create a thousand new user object and active directory. Done. But if you were to try to just focus on just the AD commandlets, you’re going to get lost and you’re going to bang your head. You’re going to say, “This really sucks and it’s an awful thing.”

Mike Pfeiffer:
Yes. You’re spot on. I think I’ve seen that too. I do a lot of live classes for Azure and AWS. One of the things that I’ve always done, especially in the last few years, is make the labs realistic as possible. No step-by-step, just bullet points like you would get from your boss. Your boss walks into your cube and says, “I need you to solve this thing and here’s the criteria,” and there’s no step-by-step and a lot of classes to your point, training classes, it’s steps one through 200 to achieve this end result, but you go through the thing and maybe it works, but you’re like, “I have no idea what I just did.” So you really got to learn… You need to learn how to solve problems, and so it sounds like the idea here is learn the basics of the PowerShell technology so you can use it to solve problems for yourself and you’re not just relying on the step by step training. So I really love that.

Jeff Hicks:
Yes, because once… You may be, say, right now, say you’re in a Hyper-V shop and so you learn PowerShell and just say, “Okay. Now I need to learn the Hyper-V commandlets.” Well they are nicely designed and they work very well in the ParCel paradigm, so that transition is pretty easy. And then you get a new job and all of a sudden, “Oh. Hey. Now we’re a VMware shop. No big deal. I’ll download and install PowerCLI.” In fact, some of the commands have the same names, we still get VM. Some of the parameters might be different, but that’s no big deal, because you know how to read help. You understand objects in the pipeline. How to use Get-Member. How to use the core commandlets. So you can easily make that transition, but if all you know is, “I know how to type these things in Hyper-V in order to achieve this effect,” yes, you may be able to get your job done, but you are never really going to go anywhere, I think, in your career.

Mike Pfeiffer:
Yes, I agree. One of the things, too, that I’ve been thinking about a lot lately, just looking at all the stuff that’s coming out from Microsoft, AWS, Google, all these guys. It looks like, obviously Microsoft has tons of investment in PowerShell, it’s very smart of them to do that, but AWS is even using it. They have their own commandlets for their entire platform. They have PowerShell supports in things like AWS Lambda, but one of the things I’ve been thinking a lot about seeing all this stuff pop up is, man, it’s got to be so hard to get started, because whatever it was eight, nine, 10 years ago when I got started, in the very early days, it was still new but it was also hard back then and just looking now, you said PowerShell’s currently in version six, I think the last time that I was really deep into PowerShell, it was the end of the PowerShell two era going into PowerShell three, and I haven’t done a ton of stuff since then.

Mike Pfeiffer:
I still write scripts very similarly to the way I did back then and stuff like that, but I guess what I’m wondering is how does somebody start now with all of the stuff in PowerShell, all the advancements and all of the support and all these different places, what’s the best place to start for somebody who’s completely brand new today that hasn’t been around like we have for the last 10 years working on PowerShell?

Jeff Hicks:
Well, if you stick with my idea of just learning core PowerShell fundamentals and when I say core, I don’t mean PowerShell core, I mean just the essential, this is the way PowerShell works, and it’s important to realize that PowerShell and Microsoft, this is what they’re pushing here and rightfully so, is a cloud language. Now it’s not the only cloud language. There are…

Mike Pfeiffer:
Yes.

Jeff Hicks:
Python would be another language… I should probably learn a bit more Python, but certainly if you’re in the Microsoft space, PowerShell is the cloud language you want to learn, because once you get those fundamentals, then containers and Azure and Hyper-V, you can manage all those things, but to get started if you really just say, “Okay, I need to know how can I get a list of services that are running on my system and export some information to a CSV file?”

Jeff Hicks:
Just really what sounds like basic stuff and it is, but then that eventually can grow into other things where you’re importing data from a SQL database and firing up ARM templates and spinning up new VM, so the concepts are still the same. The scale may change. So learning the fundamentals, and I don’t want to sound like I’m plugging this although the community is plugging it, the learn PowerShell in a month of lunches books have been… The community has said, “This is the book.” If you ask probably anyone on Twitter or in the PowerShell Facebook group or even at conferences, people will say you have the learn PowerShell a month of lunches that Don and I did, is the book. That has been the benchmark. So we’ll say at conferences, “Yes, you need to have month of lunches, minimum experience.”

Mike Pfeiffer:
Yes, I love that series of book span. That is solid. I would echo that as well. There’s no better place to start in terms of self study.

Jeff Hicks:
I can walk you through the books here. There’s the learn PowerShell in a month of lunches. Now that book it’s on Windows PowerShell and I think we redid it for version five, although the last time… The previous version was for version three and we didn’t really want to do a rewrite because the fundamentals really have not changed since version two, to be honest.

Mike Pfeiffer:
Yes.

Jeff Hicks:
But for marketing, publishing purposes, yes, okay. So whatever, we did a new version. So that’ll get you through a month of lunches learning the core PowerShell concepts. You’re not going to be a master, but you’ll be enough to be able to get started. From there, you’d want to go to learn PowerShell scripting in a month of lunches and maybe in between there you could try my PowerShell practice primer, because that’s where I wrote that thinking, “Okay. You’ve been to the month of lunches books, so you’ve got some… You understand how PowerShell works, but you need more experience with it.”

Mike Pfeiffer:
Yes.

Jeff Hicks:
And that’s the great thing about PowerShell is once you can bang out commands interactively in the console, the automation part, building things into a script, it’s just a matter of taking the same commands and putting them in a ps1 file.

Mike Pfeiffer:
Right.

Jeff Hicks:
Or, if you really want to get fancy, then creating a module and a set of reusable tools.

Mike Pfeiffer:
Yes.

Jeff Hicks:
So there’s the learn scripting, and then Don and I also on Leanpub, have the PowerShell and scripting tool making book, which was the book we’ve always wanted to write about everything you’d need to know about scripting and building modules and tools and basically automating stuff in PowerShell. So those are the books that you would learn if you want stuff to just, “How do I learn this?” But the best way to do it is you got to do it. You have to get your hands dirty. I tell people in my classes and at conferences, “You have to be in PowerShell every day. You have to do something.”

Jeff Hicks:
Even if you do nothing more than read an about topic, or read full commandlet help for some commandlet you’ve never seen before. Even if you just do that or read a blog article, listen to a podcast, but you have to be, because it’s a language like Hungarian or Chinese. I used to speak pretty passable French. I even knew a little Swedish. I haven’t spoken, had to do conversational French in 30 something years or longer and I can’t do it because those muscles have atrophied and learning power shell’s the same way. You have to do it every day.

Mike Pfeiffer:
Man, I really love that too, because I’ve been saying that a lot to everybody that I’m working with, but it’s true and then that’s how I learned PowerShell. I did the same exact thing. I was able to figure that out early and every single day I got some points on the board. That momentum starts to snowball pretty quick after you put a couple of weeks in. Once you start learning those fundamentals that you talked about, then you start getting creative and you start building your own solutions and that’s the unlock, I think, where you go from just a student to getting into that mastery level.

Jeff Hicks:
Yes [inaudible 00:16:48] reach a point, you’ll be banging your head and swearing and drinking a lot and thinking, “Oh, I can’t do this. It’s really hard,” but at some point things will click. You’ll make some little mental connection, go, “Ah, that’s what Jeff was talking about. Now I see,” and then once you make that connection, that little light bulb moment, then you wonder, “God, why did I wait so long to use this? And I can do all sorts of things.” It’s hard for me, sometimes I have to catch myself because I’ve been doing PowerShell for so long and I’m in it so long, it’s second nature to me. I don’t even think about what I’m doing. I just bang it out.

Mike Pfeiffer:
Right.

Jeff Hicks:
I was talking with my wife last night about, I’ve got a training event coming up, because she’s a professor too, and so we talk about different teaching things and she was saying, “Sometimes I worry about,” because she’s a professor now, if she reaches something that she’s taught before, but she has a little brain glitch, forgets how to do something it looks bad, and I said, “Well, you know, I’ve been doing this for so long, I can turn that into a learning opportunity,” because I may forget, “How do I do this?” But I know where to find the answer. I know how to find the answer.

Mike Pfeiffer:
Yes.

Jeff Hicks:
[inaudible 00:17:57] spend a lot of time with my classes and things that I’m doing with the community these days is, this is how you learn to learn.

Mike Pfeiffer:
That’s a great point.

Jeff Hicks:
[inaudible 00:18:06] To do your work for you, unless you want to pay me to come in and do that kind of stuff, but you need to know how to fish. You need to know how PowerShell works and understand it at a language level.

Mike Pfeiffer:
Right. I really agree with that too, because… That was actually something, there was a thread on that on Twitter a couple of days ago, where somebody was saying if you’re speaking, whether it’s a lunch and learn or you’re actually at a conference and your demos blow up, don’t let that stop you. Use it as a teaching opportunity. Show people how to solve this, because we’re all in the same boat. We need to figure out how to solve problems. It’s not about knowing everything. At this stage it’s impossible to know everything.

Mike Pfeiffer:
But I want to switch gears real quick and go back to what I said earlier, that after PowerShell version two and version three came out, that’s when I started to get out of it, but at that stage I had spent so much time that I really, like you said, I was working on it every day and even to this day I can go back and write a PowerShell script because I did that work and I spent three years doing that.

Mike Pfeiffer:
But one of the things that I did dive into for a long time, at one point, I think in either 2013, 2014, is I really spent a lot of time with desired state configuration, because I felt like that’s going to be really important and so I spent a lot of time working on that. I built some solutions around that. I actually wrote a white paper using it, because I knew it would force me to learn it and going back to this whole point of like, “Hey, build stuff so you can learn this better,” but obviously there’s a lot of integration in Azure with DSC. They’ve got a DSC extension, so you can bootstrap your virtual machines using DSC. It’s a cross platform technology so you can use it with Linux. One of the things that I’ve noticed is, especially working with enterprise customers, Azure classes, is it doesn’t seem like it’s gotten the adoption I was expecting it to get, and I’m just curious, what’s your perspective on that? How important is desired state configuration for PowerShell?

Jeff Hicks:
Well, when DSC first came out I thought it was really fantastic. I created some courseware for Pluralsight on it, I use it, I do a lot with it, but yes, somehow Microsoft never could quite get their story together, it seems, it’s my opinion, on what it should do, how it should be used. Some of this may be due, Microsoft is always reorging and I think there were some personnel changes and reorganizations and so I think DSC got lost in the shuffle a little bit.

Jeff Hicks:
If you are a pure Windows shop and want to do DSC On-Prem, yes, there’s some pretty amazing things that you can do with it. I have not done anything with the cross-platform stuff, like Ansible, or chef, or puppet, but DSC can be consumed by those products, but now that PowerShell is moving into PowerShell Core and Windows Powershell is in essence a finished platform, Microsoft is still pushing DSC and they are revising it, but like I said, a lot of their effort though is DSC in Azure.

Mike Pfeiffer:
Yes.

Jeff Hicks:
And because I’m not an Azure guy really, I don’t know how that’s going to work out. I’m still a On-Prem. I’m an old school NT four server kind of guy, so I like the On-Prem stuff and I still have a number of customers who are still big On-Prem people, which is why they want to learn PowerShell and maybe even learn a little DSC because yes, they need that for their On-Prem work. I really don’t know going forward what the story is going to be. I don’t know if DSC is going to really just be an Azure piece and maybe they’ll expose some part of it so that you can use it On-Prem, which I think is what I’d heard might be coming down the road.

Jeff Hicks:
The whole point of Microsoft’s love of cross platform though, is driving a lot of changes in DSC, because DSC as we originally know it required WS-man and the SIM infrastructure, which doesn’t exist on Linux, so in order for those things to work there has to be some…

Mike Pfeiffer:
[crosstalk 00:22:01] It’s like a special agent, right?

Jeff Hicks:
Revisions, yes, of how they’re going to manage that. I’m hoping DSC still has a future. I still think in a Windows platform, again, if you’re running Windows server that it can run PowerShell five or five one, DSC can do some amazing things for you and you should look into it. Cross platform and cloud stuff, that’s the future and I don’t know what that future’s really going to look like. Maybe the upcoming MVP summit this year, I’ll get a little more insight into that.

Mike Pfeiffer:
Yes, that should be a good event. I’m looking forward to that. On that note, I think that’s really what we’re talking about. It’s a question of practicality. Who’s going to use it in the real world? I know that Microsoft though, actually expects people to know DSC for Azure administrator exams and stuff. It was in the previous infrastructure exam as well. So there is that need, so if you’re looking to get certified, you want to have some awareness around DSC.

Mike Pfeiffer:
I think one of the most impressive places I’ve seen… Well, there’s two really impressive integrations in Azure where it really seemed to leverage the DSC a lot. Number one is with their Azure resource manager templates, so you’ve got all the infrastructure codified in a JSON template, and then basically what you can do is tell the VMs, “Hey, when you’re coming online, install the DSC extension and then go grab the DSC config out of GitHub or something,” and that’s pretty compelling, I think, if you’re doing infrastructure as code and especially if you’re a Windows shop, because you can take those fundamental PowerShell skills that you were talking about and then roll into that world, and then I think having that awareness is going to help you on the certifications as well.

Mike Pfeiffer:
But I’m also in the same boat with you wondering what the future is going to look like there. So it should be interesting. On a second note in terms of Azure, one of the things that’s really impressive is the Cloud Shell, right? It’s got Azure CLI support. It’s got PowerShell support. I’m really impressed by Azure CLI and I’m just wondering what your take on it is? Have you spent any time looking at it and if you think that one, is it interesting compared to PowerShell? What are your thoughts in terms of working with those tools for automation?

Jeff Hicks:
PowerShell itself, remember, is a management engine. It’s something that is hosted in an application. So the PowerShell window that we all see on Windows, that blue screen, that’s hosted in the cmd.exe window. PowerShell IC is hosting PowerShell VS code, it’s hosting PowerShell, so the Azure CLI shell is just another hosting application, so it’s still running PowerShell, exposing those commandlets.

Jeff Hicks:
Sure, it may be fine tuned for the Azure environment, but it’s not like you have to learn the Azure CLI. It’s still PowerShell. You’re still going to run PowerShell commands, it’s just that they’re running, not on your machine locally, they’re running up in the cloud and it’s just exposed to you through this interface. So it doesn’t… Again, it doesn’t matter. Once you know the PowerShell fundamentals, you can run in VS Code, ISE, Exchange, PowerCLI, the Azure cloud, whatever Amazon’s doing. It doesn’t matter. It’s still PowerShell, it’s just hosted in some particular application.

Mike Pfeiffer:
Got you, so using the Cloud Shell, I’m just… If I go into Cloud Shell in Azure and I pick PowerShell as the scripting engine, or whatever, then it’s just the same old PowerShell that I always know and love. It’s just running in a container managed somewhere by Microsoft, but it is running PowerShell Core, right?

Jeff Hicks:
Right. It’s running some version of PowerShell. Now, yes, there may be some things that are slightly different than the Windows PowerShell you may be used to on Windows 10, but hopefully when you get into it, if you have enough PowerShell experience, you can discover what those limitations are and understand, “Okay, this is what I can do in the shell. This is what I can’t do in the shell,” but it’s still PowerShell under the hood and you’re right, you don’t really care how it’s being hosted. You just want to know, “What can I do in it?”

Mike Pfeiffer:
Mm-hmm (affirmative). Yes, that’s a good point, and in terms of the Cloud Shell, you have two language options, right? So you can obviously pick PowerShell and then there’s the option to do Azure CLI, which is… Sometimes people confuse the CLI with the Cloud Shell, but I think that’s a Python based set of commands and what I’ve noticed is maybe it’s a little bit less verbose then PowerShell, probably just because it’s not based on the .net framework and things like that. Do you think there’s any a big benefit in folks diving into that? The actual Python based Azure CLI versus PowerShell? Or does it make more sense if you already know some PowerShell to just start there and focus on that and then maybe think about transitioning on a little bit later?

Jeff Hicks:
I guess it depends on what you can do in one Shell that you can’t do in the other that you might need to do.

Mike Pfeiffer:
Okay. Yes, I think it’s pretty cool that they have two different options there and I’ve been wondering what people are thinking there. I really like the CLI, the Azure CLI piece, just because it seems quicker to use because there’s not so much syntax. I think if I was completely brand new, didn’t know anything about either one, that one might be easier for me, but I really like what Microsoft is doing because they’re letting people take their existing skills and use them in all kinds of places inside the Azure platform and stuff.

Mike Pfeiffer:
And then the other thing I forgot to mention too, about DSC, was I’m really impressed by the DSC support in Azure automation, or whatever they’re calling it now, where you’re basically, you can create a PowerShell script, so to speak, as a service, schedule it or invoke it over HTTP with a webhook and do all these cool things. You can set up managed Pull Server environment, so if you really are doing DSC for eliminating configuration drift and stuff, you can use that infrastructure. Have you seen people using that, because I haven’t seen a ton of traction there from the folks that I’ve been working with, but it seems like a pretty compelling solution?

Jeff Hicks:
I know that in the PowerShell, or Cloud and Davidson, or MVP community, there are people doing all the, loving the Azure stuff and spinning up VMs using the templates and the commandlets, and personally that, again, that’s not something that crosses my plate very often. I’m aware of them. I would be hard pressed to give you a working example, because again, because I just don’t have any needs. I haven’t learned that little dialect, if you will, of the language, but certainly that is a compelling argument for learning PowerShell.

Mike Pfeiffer:
Sure. Yes, absolutely. I was thinking too, I mentioned earlier, AWS, they have a whole set of commandlets for their entire platform. I think the last time I looked at it, it’s been a couple of years but there was over a thousand commandlets, so pretty much anything you can do with their APIs work with any service they’ve got commandments for. One of the things that was interesting that I knew about when I worked there, I don’t know if it’s still like this, is they would actually just generate the PowerShell commandlets based off of the .net STK, so it was just automatically generated, so there was tons of commandments without help and that made it a little bit challenging, because if you know the fundamentals and your go-to is always the help and there’s none there, that’s a problem, but I’m not sure if they’ve closed that gap a little bit.

Mike Pfeiffer:
I think what’s cool is there’s other companies as well, adding support for PowerShell so people can use the investments that they’ve created for their knowledge and just come in into something like AWS and use it to do scripting, or they can actually use PowerShell as a language and there functions as a service offering in AWS Lambda, and so what you’re doing and what you’ve created is going to help people learn PowerShell and then they can use those fundamental skills that go into these other platforms. I guess the next question is, going really long term, you’re looking at five years or so, since PowerShell is built on a .net framework, what are your thoughts about the longterm lifespan for PowerShell? Is it still going to be super important in five to 10 years, since it has a dependency on the .net framework? What are your thoughts there?

Jeff Hicks:
I think it will and I’m going to parrot the company line here, this is Jeffrey Snover’s take on it, that Microsoft wants you to be able to use PowerShell from anywhere to manage anything, basically using whatever desktop or OS that you want, which is why we now have PowerShell Core. Now, yes, PowerShell Core, which allows us to run PowerShell cross-platform, we can run on Windows, Linux, Mac, and it takes it’s dependency, the .net Core, which is also open source. As .net Core continues to evolve and there’s a new version coming out. My understanding that will add some features that PowerShell will be able to take advantage of that people have been asking for. I don’t think PowerShell is going away anytime soon. Microsoft, all of their development efforts are in PowerShell Core and part of that in PowerShell Core, I have to think is also driven some by Azure, because if it’s Azure related, that’s important to Microsoft, so that’s where they’re going to focus their efforts on, but you’re right, PowerShell, and I talked about this all the time, is the glue language.

Jeff Hicks:
It’s a cloud language. Again, not the only one, but certainly one of the most important ones and definitely, if you’re in the Microsoft space, to learn and I’m torn right now in someone new to PowerShell, as to whether they should stick to Windows PowerShell or go into PowerShell Core.

Mike Pfeiffer:
Yes.

Jeff Hicks:
Now personally, for years I have kept a Windows PowerShell window open for weeks at a time and I can live my whole life in PowerShell. This year, just a couple of weeks ago and I blogged this, I’ve jumped over to PowerShell Core. Now I’m running a Windows 10 desktop so I don’t lose too much, but I’ve decided I’m just going to live in PowerShell Core, because I need to learn, because again, it’s a dialect. There are some things that are different, so I need to learn what’s different? What can I do? What can’t I do? What adjustments do I need to make in order to live in a PowerShell Core world?

Jeff Hicks:
So I’m still torn as to teaching. Do I focus on Windows PowerShell, or Core? Conferences, should my sessions now start being focused on PowerShell Core, or do I still need to focus on Windows PowerShell? That’s still up in the air. Like I said, I’ve got a two day training gig coming up in a couple of weeks and this is going to be Windows PowerShell, but I’m wondering if this is my last Windows PowerShell gig? I wonder if going forward I should focus on PowerShell Core?

Mike Pfeiffer:
I see where you’re coming from. I noticed when I first started using PowerShell in the Cloud Shell with Azure, it was super slow, because I had to start a Windows container and all this kind of stuff, so now it’s much different. It starts a Linux container for you, your Shell instance runs in there. It’s PowerShell Core. But for somebody like me that hasn’t really been diving deep into PowerShell over the last couple of years, what is the main difference? Obviously PowerShell Core can run on Linux, can run on Mac, or whatever, but what’s some of the big differences? Is there anything major that I really would need to know about how to get current?

Jeff Hicks:
Depends on what other modules or tools you may have been used to using in Windows PowerShell, because remember, Windows PowerShell and all those tools are built on the full .net framework. PowerShell Core is based on .net Core. So there are some commandlets, for example the active directory commandlets. They were originally written based on the full .net framework. So those commandlets will not work in PowerShell Core as they’re currently written.

Jeff Hicks:
Either .net Core will have to get some revisions or they may have to rewrite those command lists or maybe some combination of the two before we can use them in PowerShell Core, but the nice thing is, if you have a Windows 10 desktop, it doesn’t matter because you can run Windows PowerShell and PowerShell Core side by side. A lot of Windows modules will run in PowerShell Core. There’s a Windows compatibility module that you can load in PowerShell Core to load the Windows modules and they’ll run in PowerShell Core. They do some little magic behind the hood, up to a point, so you don’t necessarily have to give up, but that’s the big thing is that there are some things, and you won’t know until you try, that require the full .net framework and you don’t have that in PowerShell Core.

Jeff Hicks:
Another example, and this is something that really has interested or concerned a lot of people is creating GUI scripts, like a WPF or WinForms script. That requires a full .net framework. Those bits are not in the current version of .net Core, so any GUI based script you have in PowerShell is not going to run in PowerShell Core, because it doesn’t know how to access those things. My understanding is that an upcoming version of .net Core is going to bring some of those GUI bits back, which is great, at some point then, PowerShell Core has to probably be updated to recognize that. So eventually I believe I’ll be able to run my GUI scripts in PowerShell or PowerShell Core and that will be a great thing and that will make a lot of people happy.

Mike Pfeiffer:
Cool. Yes, that’s awesome. Switching gears question for you, let’s say that I am getting started with Cloud computing. I’m getting into Azure or something. What’s a good project where I could take PowerShell, what’s something I could get that hands on practice? Maybe I’ve gone through your fundamentals book. I know the basics, but now I need to apply what I’m learning and build something. What would be a good suggestion for somebody that wants to go build some solution, something achievable for somebody that’s new, but also practical and that would relate to something Azure focus?

Jeff Hicks:
I would just see if I could stand up a… To do the whole infrastructure thing in Azure. Create the resource group and your networking pieces and just stand up a Windows 10 desktop.

Mike Pfeiffer:
Okay. Yes, I like that. That’s one of the things that I was talking about. I did an episode on infrastructures code, a couple of weeks ago, and the thing that usually paralyzes people with that is just looking at this thousand lines of code, but really got to start with one thing. Small thing. So I like the idea of just starting with one virtual machine. Start writing a script that just builds one VM or does something very simple and then start building upon it from there.

Mike Pfeiffer:
So that’s awesome, Jeff. I really appreciate your perspective on the stuff that we’ve talked about and I think PowerShell is super important, especially for you guys that are coming over from a Windows shop. There’s a lot of people doing that coming into Azure, but remember if you’ve got those skills, you can leverage them on other platforms as well. Jeff, where’s the place that we could find you online to see what you’re doing in terms of PowerShell? I know you’re blogging and sharing a lot on social.

Jeff Hicks:
Yes, Twitter’s probably the best place. I’m just Jeff Hicks and I blog, I’ll give you the links. You can put that in the show notes. I do some writing for the Altero blogs, a lot of Hyper-V and PowerShell stuff, so people… Cloud-ish content there. I speak at conferences, do the Pluralsight stuff, but if people want to track me down, Twitter’s probably the best place.

Mike Pfeiffer:
Great. Okay, cool, and then you said your books, most of your books, or newer books are on Leanpub, right? And the latest one is PowerShell fundamentals, right?

Jeff Hicks:
It’s the PowerShell practice primer.

Mike Pfeiffer:
Primer. Okay.

Jeff Hicks:
Yes, it’s 100 exercises. Again, no scripting, just one or two lines of code or commands you would type in order to answer or solve the problem that I give you.

Mike Pfeiffer:
Awesome. Yes, I’m going to check that out. I love the idea of having multiple, a hundred exercises like that. It’s brilliant. So yes, hopefully maybe we can get you back on the show here, later on when we know more about what’s going on with PowerShell Core as that matures and things go forward, but I really appreciated you being on the show here. It’s good to catch up with you, my friend, and thanks so much.

Jeff Hicks:
Thank you very much and I hope to see you around this year.

Mike Pfeiffer:
Want to keep up with what’s going on in cloud computing? If so, subscribe to my weekly newsletter and get my top five tips every week for staying on top of Azure, AWS, and Google Cloud. Just go to askmike.io/subscribe to join today. Every week I’ll send out information about Cloud architecture and development, containerized applications with Docker and Kubernetes, dev ops and automation and strategies for getting the latest Cloud computing certifications. So if that sounds awesome to you, go to askmike.io/subscribe to join the list today?

Subscribe to the CloudSkills Weekly Newletter

Get exclusive access to special trainings, updates on industry trends, and tips on how to advance your career in the tech industry.