Skip to main content

More Powershell DSC resources released


The PowerShell Blog has released information about the second wave of resources to use in your Desired State Configuration. Looks like the guys have been really busy  and released some neat resources for us.

Here is the list:

Resource Description Module Name Link
xADDomain Create and manage an Active Directory Domain xActiveDirectory click here
xADDomainController Create and manage an AD Domain Controller xActiveDirectory click here
xADUser Create and manage an AD User xActiveDirectory click here
xWaitForADDomain Pause configuration implementation until the AD Domain is available.  Used for cross machine synchronization. xActiveDirectory click here
xSqlServerInstall Create and manage a SQL Server Installation. xSqlps click here
xSqlHAService Create and manage a SQL High Availability Service. xSqlps click here
xSqlHAEndpoint Create and manage the endpoint used to
access a SQL High Availability Group.
xSqlps click here
xSqlHAGroup Create and manage a SQL High Availability Group. xSqlps click here
xWaitForSqlHAGroup Pause configuration implementation until a
SQL HA Group is available.  Used for cross machine synchronization.
xSqlps click here
xCluster Create and manage a cluster. xFailOverCluster click here
xWaitForCluster Pause configuration until a cluster is available.  Used for cross machine synchronization. xFailOverCluster click here
xSmbShare Create and manage a SMB Share. xSmbShare click here
xFirewall Create and manage Firewall rules xNetworking click here
xVhdFile Manage files to be copied into a Vhd. xHyper-V click here
xWebsite Added functionality to xWebsite to support configuration of https websites. xWebAdministration click here
xVhd Bug fixes xHyper-V click here

This is starting to look really promising. With the second wave of resources, DSC is beginning to look like an enterprise “product” that the IT-pros could embrace with vengeance. First off they have now included an resource to not only manipulate the objects in Active Directory, however also the infrastructure with the xADDomain and xADDomainController resources. As I have previousely commented in my blog, this was one of the missing elements of DSC. I even looked into creating an custom resource for manipulating AD-objects myself using the custom resource in DSC.

Secondly with the release of the SQL resources, we can now handle deployment of a full 3-tier application all in Powershell DSC. If your company is building software and you have not yet started looking in to DSC, now is the time to start. May I ask why you have not started? Normally software runs through 3-4 stages:
  1. Birth (created in an development environment)
  2. Test/Staging environment
  3. QA-environment
  4. Production environment
Agile development suggests that the software moves through this cycle several times during a year, maybe several times each month. What is the tasks required between these stages? Somthing like this perhaps:
  1. Create the required virtual machines to be used (normally perhaps a web-server and a database-server), DSC xHyper-V resource
  2. Install the required roles/features, built-in DSC resource
  3. Install other required software, built-in DSC resource
  4. Configure web-server/sql server DSC xSQLps and xWebAdministration
  5. Congfigure users, DSC xADUser
  6. Install your custom software, built-in DSC resource
By investing into DSC your software would enjoy an identical environment between the different stages of it’s live and thus reducing the time and cost of release. Even if you do not create the entire stage in DSC, your ROI (Return On Investment) would be very nice. Tell that to your boss and get starting with DSC and PowerShell.

Now if you are not into software development, you probably have some other scenario where you could use DSC. If you are doing manually repetitive tasks that DSC could do for you, my advice to you would be that you are doing it the wrong way. Automation has been around for ages, however with DSC and PowerShell this is looking to be easier than ever.

Enjoy the new resources, I will :-)


Popular posts from this blog

Developing PowerShell modules for REST APIs – Part1

Over the years I have developed different PowerShell modules for different web APIs. I thought it would be a good idea to write a 2 series post about how you could go about to do this. This will be a 2 part blog series where we will run through the entire process of building a module for a REST API. I will try my best to keep this as simple as possible and leave more advanced stuff for a follow up post if the interest is there.What you needDepending on your experience with source control and PowerShell in general, you might want to use GIT or some other software repro for the code. In addition we are going to create a test REST API using the splendid UniversalDashboard PowerShell module created by Adam Driscoll. It is available on the PowershellGallery. Other prerequisites are built-in to Powershell. I will assume that you will be following along using at least PowerShell version 5 or greater.
What is HTTP metods for REST API.The primary or most common HTTP verbs used are POST, GET, PU…

Serialize data with PowerShell

Currently I am working on a big new module. In this module, I need to persist data to disk and reprocess them at some point even if the module/PowerShell session was closed. I needed to serialize objects and save them to disk. It needed to be very efficient to be able to support a high volume of objects. Hence I decided to turn this serializer into a module called HashData.

Other Serializing methods

In PowerShell we have several possibilities to serialize objects. There are two cmdlets you can use which are built in:
Both are excellent options if you do not care about the size of the file. In my case I needed something lean and mean in terms of the size on disk for the serialized object. Lets do some tests to compare the different types:


You might be curious why I do not use the Export-CliXML cmdlet and just use the [System.Management.Automation.PSSerializer]::Serialize static method. The static method will generate the same xml, however we …

Developing PowerShell modules for REST APIs – Part2

This is part 2 of the REST API blogpost. In part1 we successfully setup two REST API endpoints using the UniversalDashboard PowerShell module. In this part we are going to create a simple module that support some CRUD operation against our API. As we are trying to keep things as simple as possible, we will not use any fancy framework (like Plaster) to build our module. We are also going to skip a very important step you should familiarize yourself with, Pester tests. Lets get to it.

The moduleWe will build a module called FilesAPI. The module folder will look like this:

In the functions folder I have already added the 2 helper functions from part 1, Get-AuthorizationHeader and ConvertTo-Base64. The other folders are just placeholders for important stuff like classes, private functions that you do not want to make available for the module consumer and tests for Pester tests. For such a small module that we are going to create, one could argue that it is much easier to just add the functi…