DSCResources/STWebTier/STWebTier.schema.psm1
configuration STWebTier { param( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$Ensure, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$WebsiteName, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$Port, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$WebAppName, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$WebAppPoolName, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$PhysicalPathWebsite, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$DestinationPath, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$DeploymentPath, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$State) Import-DscResource -Module xPSDesiredStateConfiguration Import-DscResource -Module xWebAdministration xPackage InstallAzureEmulator { Ensure = $Ensure Name = "Windows Azure Emulator 2.2" Path = Join-Path $DeploymentPath "WindowsAzureEmulator-x64.exe" ProductId = "" Arguments = "/quiet /norestart" InstalledCheckRegKey = "SOFTWARE\Microsoft\Windows Azure Emulator" InstalledCheckRegValueName = "FullVersion" InstalledCheckRegValueData = "2.2.6492.2" } WindowsFeature IIS { Ensure = $Ensure Name = "Web-Server" IncludeAllSubFeature = $true } WindowsFeature AspNet45 { Ensure = $Ensure Name = "Web-Asp-Net45" } File WebsiteCopy { Ensure = $Ensure Type = "Directory" Recurse = $true SourcePath = Join-Path $DeploymentPath $WebAppName DestinationPath = $DestinationPath DependsOn = @("[WindowsFeature]IIS", "[WindowsFeature]AspNet45") Checksum = "modifiedDate" } xWebAppPool StockTraderAppPool { Name = $WebAppPoolName Ensure = $Ensure State = $State DependsOn = "[File]WebsiteCopy" } xWebSite DefaultWebsite { Name = "Default Web Site" PhysicalPath = "C:\inetpub\wwwroot" State = "Stopped" } xWebSite StockTraderWebsite { Name = $WebsiteName Ensure = $Ensure BindingInfo = MSFT_xWebBindingInformation { Port = $Port } PhysicalPath = $PhysicalPathWebsite State = $State DependsOn = @("[xWebAppPool]StockTraderAppPool", "[xWebSite]DefaultWebsite") } } |