Book Image

Learning PowerShell DSC

By : James Pogran
Book Image

Learning PowerShell DSC

By: James Pogran

Overview of this book

Table of Contents (14 chapters)
Learning PowerShell DSC
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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
      PhysicalPath = $Node.WebSiteFolder
      BindingInfo  = MSFT_xWebBindingInformation{
        Protocol = 'HTTP'
        Port     = '80'
      }
      DependsOn...