-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.ps1
More file actions
82 lines (78 loc) · 2.45 KB
/
setup.ps1
File metadata and controls
82 lines (78 loc) · 2.45 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#==================
# Global Flags ====
$ErrorActionPreference = 'Stop'
#==================
# Variables =======
$sitesDir = "C:/Sites"
$websiteDir = "$sitesDir/DotNetNuke"
$zipFile = "C:/DotNetNuke.zip"
#==================
# Main ============
Install-Module xWebAdministraion -Force
Install-Module cNtfsAccessControl -Force
Configuration DNNSetup
{
Import-DscResource -ModuleName PSDesiredStateConfiguration, xWebAdministration, cNtfsAccessControl
node localhost
{
File SitesDirectory
{
Ensure = "Present"
Type = "Directory"
DestinationPath = $sitesDir
}
File DotNetNuke_WebsiteDir
{
Ensure = "Present"
Type = "Directory"
DestinationPath = $websiteDir
DependsOn = @("[File]SitesDirectory")
}
xWebAppPool DotNetNuke_AppPool
{
Name = "DotNetNuke"
Ensure = "Present"
State = "Started"
autoStart = $true
startMode = "AlwaysRunning"
identityType = "ApplicationPoolIdentity"
}
cNtfsPermissionEntry DotNetNuke_DirPermission
{
Ensure = "Present"
Path = $websiteDir
Principal = "IIS APPPOOL\DotNetNuke"
AccessControlInformation = cNtfsAccessControlInformation
{
AccessControlType = "Allow"
FileSystemRights = "Modify,ReadAndExecute,ListDirectory,Read,Write"
}
DependsOn = @("[File]DotNetNuke_WebsiteDir","[xWebAppPool]DotNetNuke_AppPool")
}
xWebsite DotNetNuke_Site
{
Name = "DotNetNuke"
Ensure = "Present"
PhysicalPath = $websiteDir
State = "Started"
BindingInfo = MSFT_xWebBindingInformation
{
Protocol = "http"
IPAddress = "*"
Port = "80"
Hostname = "dnndev.me"
}
ApplicationPool = "DotNetNuke"
PreloadEnabled = $true
ServiceAutoStartEnabled = $true
AuthenticationInfo = MSFT_xWebAuthenticationInformation
{
Anonymous = $true
}
DependsOn = @("[File]DotNetNuke_WebsiteDir", "[xWebAppPool]DotNetNuke_AppPool")
}
}
}
DNNSetup
Start-DscConfiguration -Path .\DNNSetup -Wait -verbose -Force
Expand-Archive -LiteralPath $zipFile -DestinationPath $websiteDir