-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbootstrap.ps1
106 lines (84 loc) · 2.27 KB
/
bootstrap.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER DoNotInstallRequired
.PARAMETER InstallRecommended
.EXAMPLE
Open IE or Edge browser and navigate to following URL: https://raw.githubusercontent.com/chiragp/Sitecore-Dev-Machine/master/box.ps1
.EXAMPLE
.NOTES
#>
param
(
[Switch]
$SkipInstallRequiredApps = $false,
[Switch]
$SkipInstallRecommendedApps = $false,
[Switch]
$SkipSitcoreTools = $false,
[Switch]
$SkipWindowsUpdate = $false
)
function Set-EnvironmentVariable
{
param
(
[String]
[Parameter(Mandatory=$true)]
$Key,
[String]
[Parameter(Mandatory=$true)]
$Value
)
[Environment]::SetEnvironmentVariable($Key, $Value, "Machine") # for reboots
[Environment]::SetEnvironmentVariable($Key, $Value, "Process") # for right now
}
if ($SkipInstallRequiredApps)
{
Set-EnvironmentVariable -Key "BoxStarter:SkipInstallRequiredApps" -Value "1"
}
if ($SkipInstallRecommendedApps)
{
Set-EnvironmentVariable -Key "BoxStarter:SkipInstallRecommendedApps" -Value "1"
}
if ($SkipSitcoreTools)
{
Set-EnvironmentVariable -Key "BoxStarter:SkipSitcoreTools" -Value "1"
}
if ($SkipWindowsUpdate)
{
Set-EnvironmentVariable -Key "BoxStarter:SkipWindowsUpdate" -Value "1"
}
<#
if ($SqlServer2016IsoImage)
{
Set-EnvironmentVariable -Key "choco:sqlserver2016:isoImage" -Value $SqlServer2016IsoImage
if ($SqlServer2016SaPassword) {
# enable mixed mode auth
$env:choco:sqlserver2016:SECURITYMODE="SQL"
$env:choco:sqlserver2016:SAPWD=$SqlServerSaPassword
}
}
if ($SqlServer2014IsoImage)
{
Set-EnvironmentVariable -Key "choco:sqlserver2014:isoImage" -Value $SqlServer2014IsoImage
if ($SqlServer2014SaPassword) {
# enable mixed mode auth
$env:choco:sqlserver2014:SECURITYMODE="SQL"
$env:choco:sqlserver2014:SAPWD=$SqlServerSaPassword
}
}
#>
$installScript = "https://raw.githubusercontent.com/chiragp/Sitecore-Dev-Machine/master/box.ps1"
$webLauncherUrl = "http://boxstarter.org/package/url?$installScript"
$edgeVersion = Get-AppxPackage -Name Microsoft.MicrosoftEdge
if ($edgeVersion)
{
Start-Process microsoft-edge:$webLauncherUrl
}
else
{
$IE=new-object -com internetexplorer.application
$IE.navigate2($webLauncherUrl)
$IE.visible=$true
}