-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathinstall.ps1
75 lines (67 loc) · 1.86 KB
/
install.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
Param
(
[Parameter (Mandatory = $false)]
[object]$inputJson,
[string]$existingWVDWorkspaceName,
[string]$existingWVDHostPoolName,
[string]$existingWVDAPpGroupName,
[string]$servicePrincipalApplicationID,
[string]$servicePrincipalPassword,
[string]$azureADTenantID,
[string]$resourceGroupName,
[string]$azureSubscriptionID,
[string]$drainMode,
[string]$createWorkspaceAppGroupAsso
)
#
#$inputJson = @"
#{
# "enableRemoting": {
# "active": "yes"
# },
# "installWindowsDependencyAgent": {
# "active": "no"
# },
# "formatDatadisk": {
# "active": "yes"
# }
# }
#"@
#
## Convert object to actual JSON
try
{
$json = $inputJson | ConvertFrom-Json
}
catch
{
$inputJson | Out-File C:\Temp\inputJson.txt -Encoding utf8
}
. .\customscriptdefaults.ps1
if ($json.enableRemoting.active -eq "yes")
{
Write-Log -logText "Enable Remoting"
Enable-Remoting
}
if ($json.formatDatadisk.active -eq "yes")
{
Write-Log -logText "Format extra disks"
Enable-Disks
}
if ($json.installWindowsDependencyAgent.active -eq "yes")
{
Write-Log -logText "Install Windows Dependency Agent"
Install-WindowsDependencyAgent
}
if ($json.installSecureBaselineLGPO.active -eq "yes")
{
Write-Log -logText "Install Azure Secure Baseline (LGPO)"
Add-AzureSecureBaseline
}
if ($json.configureAsWVDManagementServer.active -eq "yes")
{
Write-Log -logText "Confirguring as WVD Management Server"
. .\Add-WVDHostToHostpoolSpring.ps1 $existingWVDWorkspaceName $existingWVDHostPoolName $existingWVDAPpGroupName $servicePrincipalApplicationID $servicePrincipalPassword $azureADTenantID $resourceGroupName $azureSubscriptionID $Drainmode $createWorkspaceAppGroupAsso
}
Write-Log -logText "End"
Send-TeamsLogging -factsLogging $global:teamsLogging