forked from timothywarner/az400
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakeWebServer.ps1
63 lines (56 loc) · 1.89 KB
/
MakeWebServer.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
configuration MakeWebServer
{
Import-DscResource -ModuleName @{ModuleName = 'xWebAdministration';ModuleVersion = '1.19.0.0'}
Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
WindowsFeature WebServer
{
Ensure = 'Present'
Name = 'Web-Server'
}
# IIS Site Default Values
xWebSiteDefaults SiteDefaults
{
ApplyTo = 'Machine'
LogFormat = 'IIS'
LogDirectory = 'C:\inetpub\logs\LogFiles'
TraceLogDirectory = 'C:\inetpub\logs\FailedReqLogFiles'
DefaultApplicationPool = 'DefaultAppPool'
AllowSubDirConfig = 'true'
DependsOn = '[WindowsFeature]WebServer'
}
# IIS App Pool Default Values
xWebAppPoolDefaults PoolDefaults
{
ApplyTo = 'Machine'
ManagedRuntimeVersion = 'v4.0'
IdentityType = 'ApplicationPoolIdentity'
DependsOn = '[WindowsFeature]WebServer'
}
File WebContent
{
Ensure = "Present"
SourcePath = $SourcePath
DestinationPath = $DestinationPath
Recurse = $true
Type = "Directory"
DependsOn = "[WindowsFeature]AspNet45"
}
xWebsite NewWebsite
{
Ensure = "Present"
Name = $WebSiteName
State = "Started"
PhysicalPath = $DestinationPath
DependsOn = "[File]WebContent"
BindingInfo = MSFT_xWebBindingInformation
{
Protocol = 'https'
Port = '443'
CertificateStoreName = 'MY'
CertificateThumbprint = 'BB84DE3EC423DDDE90C08AB3C5A828692089493C'
HostName = $Website
IPAddress = '*'
SSLFlags = '1'
}
}
}