DSC Resource: Create an unattend.xml file

Today, it’s a quick post to give you a custom dsc Resource of mine..

Bellow, here is a script that you have to reg in a *.psm1 file to enable you creating very basic unattend.xml file for your installations, it’s very helpfull when building your home lab, or other infras 🙂

Like always with DSC, here is how create it and use it 🙂

The unattend template file credit goes to @energizedtech from his technet hyper-v script 🙂

Using in a configuration

 Building the resource

To build the skeleton, please use New-xDscResource cmdlet 😉

Once the modules directory created pleas put a psd1 file in the module root directory -> C:\Program Files\WindowsPowerShell\Modules\cUnattend

Overwrite the psm1 file by this code:

This XML must be located somewhere accesible by your node, it can also stored in the module file, but you know, i’m lazy…

You can find all informations here to recreate the module if you need more details about how create your resource.