The setup

The scenario was first presented by Gael Colas (SynEdgy Limited), Matt Hitchcock (Microsoft Singapore), Raimund Andree (Microsoft Germany), and Jan-Hendrik Peters (Microsoft Germany) at the PowerShell Conference Europe in Hanover, 2018.

This scenario is such a good fit that all of us have taken it into production environments and pitched it to customers and peers. The majority of the conceptual work was done by Gael, who developed Datum and thought of the overall concept of the project.

The scenario proposes integration into source control (Git) as well as integration into a CI pipeline, for example, Team Foundation Server 2017. The sample scenario we will examine will contain two environments—development and production—and two machines for each environment.

The first step is to clone the repository to get the current code. The entire project revolves around the node data generation as well as the build process, including tests. Take a look at the following code:

# First things first
git clone https://github.com/automatedlab/dscworkshop

# Explore the repository
Set-Location -Path .DscWorkshopDscSample
Get-ChildItem

# Create the first build and download dependencies
..build.ps1 -ResolveDependency

# Explore the final code
# The DSC composite resources
Get-ChildItem .DSC_Configurations

# And the configuration data
Get-ChildItem -File -Recurse -Path .DSC_ConfigData

After you have cloned the repository and familiarized yourself with the environment, you will notice the following folders:

Folder

Purpose

DSC_ConfigData

The data layer that is fed into your configuration

DSC_Configurations

The composite resources that are referenced as building blocks in your configuration data

BuildOutput

The directory containing your MOF and meta.mof to deploy


Optionally, there is a lab environment that you can roll out to follow, along with an entire CI/CD pipeline in place. However, this is completely optional and just illustrates why a pipeline makes sense.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset