PowerShell DSC: 4 tips to get started right now
- select the contributor at the end of the page -
Have you ever wanted to be like “Star Trek’s” Captain Picard and simply have everything done with one simple command? In the show, someone would ask Picard a question of how he’d like to proceed on a particular task. Once he decided, he’d simply reply, Make it so—and it would just happen. He didn’t have to worry about how to actually do it; he had his staff for that. Wouldn’t that be nice?
Maybe you wish you had it as easy as Picard, but let’s be real—that’s not likely to happen. Thankfully, you have access to the next best thing, and that’s PowerShell Desired State Configuration (DSC).
What is DSC?
DSC is a technology introduced in PowerShell v4 and, although it’s still in its early stages, it’s already proving hugely beneficial in the Windows system administration space. With DSC, administrators can manage configurations of servers by simply changing a couple of lines in prebuilt DSC resources versus writing an entire PowerShell script to accomplish the same thing. Maybe you’ve been writing PowerShell scripts for a while and have heard about DSC but haven’t taken the time to dive in. And that’s exactly why I’ve thrown together a few tips to help you get started.
4 tips to getting started with DSC
1. Watch the Getting Started with Desired State Configuration (DSC) MVA video. If you’ve never touched DSC before this is a great starting point. Hosted by Pluralsight’s illustrious Jason Helmick and PowerShell creator Jeffrey Snover, this video series is over 10 hours long and covers all the basics you’ll need to get started. This series takes you from knowing nothing about DSC all the way up to building your first pull server and delivering configurations to your servers in no time.
2. Watch the Windows PowerShell Desired State Configuration Fundamentals Pluralsight course. Brought to you by PowerShell MVP Jeff Hicks, this is another great video training resource to get started with DSC. Being a Pluralsight course, this method is most similar to a classroom training exercise with lots of demos. It’s a great refresher on topics covered in the aforementioned MVA videos, while also hitting some different points that you didn’t get the first time around.
3. Read the Windows PowerShell Desired State Configuration Revealed book. If you learn better from a book, this is a great one to check out. Written by PowerShell MVP Ravikanth Chaganti, the book covers plenty of the same material that you might have missed if you skipped the video training courses.
4. Start with a Problem. Maybe you have a new server you need rolled out, or some Active Directory users you need created, or maybe just a few features you need installed on a new Windows server. Whatever the case, you can use DSC to get it done. You’ll find that you can’t do everything you can with native PowerShell right out of the box, but there are still a ton of DSC resources Microsoft has provided to get you started. Picking a personal problem is something that no outside learning material will offer. Assigning yourself a real task, is a great way to instantly personalize your learning—not to mention that it has the added bonus of solving an actual problem.
Looking for more?
Head on over to the PowerShell team’s DSC Resource Github repository and see what resources already exist. Do you see a resource that fits what you’re doing? Download it. Play around with it and see if you can accomplish the same task with DSC you were going to do manually or with native PowerShell.
If anything, take a few minutes to read some DSC articles online. Don’t get overwhelmed and try to roll out an entire new server infrastructure overnight. Instead, take small bites. Once you’ve learned the basics, you’ll then be able to start and finish bigger and bigger DSC projects. Before you know it, you’ll have your entire server infrastructure automated.