Skip to main content

Powershell – The DSC book

Don Jones (@concentrateddon) is writing this awesome book about DSC. Please help him review the contents and make suggestions. You may leave feedback on the Powershell.org/FAQ web page (just create a new post there).


I have been working as an consultant in IT since 1999, I have done a lot of strange “things” (work related that is). I have done my fair share of vb-scripting and small GUIs or console application development using vb.net etc. I have even created an automation solution/"framework" with powershell and .net (.net Forms). I have been using powershell since exchange 2007, however the last 2 years I have been a “heavy” user writing advanced scripts/functions, dot-sourcing, creating small modules etc. Full disclosure; I am not exaggerating when I say I am super excited about DSC.

My comments (in random order, when I say you/your I target Mr Jones, I think :-))
  • DSC resources – As you mention Microsoft has released 2 waves of additional resources for DSC. What are your thoughts about using these resources in production compared to creating your own custom DSC resources. They are marked x for experimental according to Microsoft…
  • Overall strategy/design of a DSC "solution" – I must admit I struggled with how you should create the configuration when you are limited to a single MOF-file. That is until I read a post about Composite resources in January I think. It is super important that people understand how they go about creating their DSC structure. Maybe you could include some general key "design-rules" for the DSC solution.
  • Credentials and security – Take the package resource (built-in). It is not perfectly clear that the credentials you supply is used for accessing the network location you have specified for the SourceFiles and not for the "installation" of the package (since you brought up the productID challenge).
  • Complicated application packages – How or can do you install those with DSC. Say you have an installer that is capable of setting up an application in an scaleout manner, that is you install the application and the database is hosted on another computer and the setup/installer does the initial configuration for the database. Could you use DSC for that? If so an example would be very cool and most helpful.
  • Show how to use multiple dependencies for DependsOn - DependsOn = @("[WindowsFeature]HyperV", "[File]VHDFolder")
  • Why DSC – The argument for DSC – More information and marketing (like this book) is needed to promote the new way of configuring your datacenter and infrastructure. Even with your rants – i like those by the way – there is still people that do not get the full picture of what is slowly happening. Automation is the future, however if you are scoping your book to a wide audience, perhaps you could include an executive summary for the none-technical readers that are wondering what the DSC-fuzz is all about.
  • Monitoring of DSC – Being a System Center guy with focus on SCOM, I would like to monitor DSC  with an ManagementPack (monitor both the PUSH/PULL infrastructure and the individual DSC target nodes testing for configuration drift). It maybe of topic for your book, however this may be where compliance comes into play somehow?
  • Azure/Windows Azure Pack – Wouldn’t it be a wonderful to have DSC resource for it?
  • ConfigMgr Desired State vs Powershell DSC – Why use Powershell DSC instead. I do not know if the desired state in ConfMgr is used by organizations,maybe they rely on GPO?
  • Group Policy vs Powershell DSC – Must also admit that I have a love2hate relationship with GPO. Why should enterprises start to replace GPO with DSC? What can you write to convince them that DSC is the bucket of gold they shall find at the end of the rainbow?
  • How to prevent overwriting of the current configuration for a node by accident or pure evil intent. Compliance I guess?
Please feel free to ignore the comments that does not suit your thoughts or the scope of your book. Keep up the good work, we are hungry for more.

Cheers

Comments

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:
Export-CliXmlConvertTo-JSON
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:


(Hashdata.Object.ps1)

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…