PowerShell Desired State Configuration (DSC) Journey – Day 23

After yesterday’s shenanigans I am ready to move on to the next step.  Here is my current Configuration.

Now, following along with this article I am currently testing Option 1 – Inject a DSC Configuration (.ps1) into a VHD.  A couple of things from that example that I need to add to my Configuration.  It starts with Powershell -c .  I have no idea what this does and can’t find any information on it but I will include it anyways.  If I run that itself in PowerShell I just get the help syntax.  And I need to add the line to start the DSC Configuration.  Here is the updated Configuration.

I have saved the above Configuration as DSCTemplate.ps1 .  This is the file I will be injecting into the VHD Template in Virtual Machine Manager (I hope).  First step is to download the unattend.xml from that article.  Second step is to create a RunDSC.cmd file.  Using the example in the article this is the contents of my RunDSC.cmd.

On my Template VM I create a C:\DSC directory and copy the RunDSC.cmd and DSCTemplate.ps1 files.  The unattend.xml gets copied under the root directory (C:\).  Now, time to create a template from this VM, deploy it and see what happens.  That’s where we will pick up tomorrow.