PowerShell DSC Resource Design and Testing Checklist

DSC Resource Design and Testing Checklist   Writing Desired State Configuration Resources is not trivial and there’s many things which can go wrong. You should always spend significant amount of time testing resources you create. This task, although critical for quality, is often overlooked or performed carelessly and insufficiently. Below you can find DSC Resource… Read more

PowerShell Sessions, Slides and Demos from TechEd 2013

We presented following sessions at this year’s edition of TechEd(s). At TechEd, we announced the newest feature in Windows PowerShell 4.0 – Desired State Configuration, so do check out the attached demos for it!! Desired State Configuration in Windows PowerShell TechEd-NA Session Video: http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/MDC-B302 TechEd-NA Slides: http://video.ch9.ms/sessions/teched/na/2013/MDC-B302.pptx TechEd-Europe Session Video: http://channel9.msdn.com/Events/TechEd/Europe/2013/MDC-B302 TechEd-Europe Slides: http://video.ch9.ms/sessions/teched/eu/2013/MDC-B302.pptx Demos:… Read more

Cmdlet Help Editor is now released on CodePlex

I published the source code for the Cmdlet Help Editor on CodePlex here: http://cmdlethelpeditor.codeplex.com/ . Please feel free to contribute. for more information on the Cmdlet Help Editor, please check out the following post: http://blogs.msdn.com/b/powershell/archive/2007/09/01/new-and-improved-cmdlet-help-editor-tool.aspx  Wassim Fayed [MSFT]… Read more

Scaling and Queuing PowerShell Background Jobs

A couple of months ago I had asked the PowerShell MVPs for suggestions on blog topics. Karl Prosser, one of our awesome MVPs, brought up the topic of scaling and queuing background jobs. The scenario is familiar: You have a file containing a bunch of input that you want to process and you don’t want… Read more

Advanced Debugging in PowerShell

Here is a collection of tips and tricks to debug PowerShell Read UpThere is a 7-part series of “Debugging Monad Scripts” that Jon Newman wrote a few years ago that covers a lot of tips, including error handling, traps, tracing, and covers a lot of V1 stuff. Clean codeThe best route, is to make sure… Read more

Adding Custom Cmdlet Help for Providers

A new feature of Windows PowerShell 2.0 lets you write custom cmdlet help for Windows PowerShell providers. This blog explains how to do it. (The topic will also be covered in excruciating detail in MSDN, but we don’t want you to wait.)   What’s a Provider? A Windows PowerShell provider is a C# program that… Read more

How to Create an Object in PowerShell

Today someone in Xbox Live Operations (the folks that keep xBox Live alive and well) pinged me with a simple question about PowerShell with a complicated answer: “How do I create a class in PowerShell?” There’s two scenarios I find where people want classes.  The first (and most common) is familiarity: the person wants to… Read more

How To Write a Console Application in PowerShell with Add-Type

Windows PowerShell CTP3 has a lot of very cool things.  CTP2 introduced the Add-Type cmdlet, which allowed you to dynamically compile C# in PowerShell.  It was actually possible to use the CompilerParameters to Add-Type to make a console application, but it wasn’t particularly easy.  In CTP3, we’ve made this a lot easier to do. There’s… Read more

What the Heck is an ENUM?

In my latest post Explore your [Environment] I said the following: PS> [System.Environment+SpecialFolder] IsPublic IsSerial Name                                     BaseType ——– ——– —-                                     ——– False    True     SpecialFolder                            System.Enum Notice that it is an ENUM.  The great things about ENUMS is that when you specify an invalid value – it tells you what the valid values are: One of… Read more

Explore Your [Environment]

This topic is a little long but I strongly encourage you to walk through it and master the techniques it illustrates.  I can assure you that you’ll will use them a couple thousand times in the next couple of years. .Net provides a wonderful class called System.Environment that tells you all about your environment.  It… Read more