O'Reilly logo

Learning PowerShell DSC by James Pogran

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Pulling DSC configurations with a DSC Pull Server

We briefly covered compiling DSC configurations for use on a Pull Server in Chapter 2, DSC Architecture, and we will build on that introduction here. We are going to use the following example DSC configuration with our DSC Pull Server. It's not fancy and it doesn't do a whole lot, but it is great at showing how DSC Pull Servers do the work for us:

Configuration SetupTheSite
{
  Import-DscResource -Module PSDesiredStateConfiguration
  Import-DscResource -Module xWebAdministration

  Node $AllNodes.Where({ $_.Roles -contains 'Target'}).NodeName
  {
    WindowsFeature IIS
    {
      Ensure = 'Present'
      Name   = 'Web-Server'
    }
    <#..#>
    xWebsite NewWebsite
    {
      Ensure       = 'Present'
      State        = 'Started'
 Name = $Node.WebSiteName ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required