-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcompile.ps1
178 lines (147 loc) · 10.1 KB
/
compile.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
$OFS = "`r`n"
$scriptname = "win11deb.ps1"
if (Test-Path -Path "$($scriptname)")
{
Remove-Item -Force "$($scriptname)"
}
Write-output '
################################################################################################################
### ###
### WARNING: This file is automatically generated DO NOT modify this file directly as it will be overwritten ###
### ###
################################################################################################################
' | Out-File ./$scriptname -Append -Encoding ascii
Get-Content .\scripts\start.ps1 | Out-File ./$scriptname -Append -Encoding ascii
Get-Content .\scripts\main.ps1 | Out-File ./$scriptname -Append -Encoding ascii
Write-output '
################################################################################################################
### ###
### INFO: JSON CONFIGS ###
### ###
################################################################################################################
' | Out-File ./$scriptname -Append -Encoding ascii
Get-ChildItem .\config\applications.json | ForEach-Object {
$jsonObject = (Get-Content $_.FullName) -join "`n" | ConvertFrom-Json
$convertedArray = $jsonObject | ForEach-Object {
$objString = @{
'id' = $_.id
'name' = $_.name
'winget'= $_.winget
} | ConvertTo-Json -Compress
"'$objString'"
}
$convertedArrayString = "@(" + ($convertedArray -join ',' ) + ")"
Write-Output "`$programs = $convertedArrayString" | Out-File ./$scriptname -Append -Encoding ascii
}
Get-ChildItem .\config\msAppxDebloat.json | ForEach-Object {
$jsonObject = (Get-Content $_.FullName) -join "`n" | ConvertFrom-Json
$convertedArray = $jsonObject | ForEach-Object {
$objString = @{
'id' = $_.id
'name' = $_.name
} | ConvertTo-Json -Compress
"'$objString'"
}
$convertedArrayString = "@(" + ($convertedArray -join ',' ) + ")"
Write-Output "`$appx = $convertedArrayString" | Out-File ./$scriptname -Append -Encoding ascii
}
Write-output '
################################################################################################################
### ###
### INFO: HELPER FUNCTIONS ###
### ###
################################################################################################################
' | Out-File ./$scriptname -Append -Encoding ascii
Get-ChildItem .\functions\private\helper -Recurse -File | ForEach-Object {
Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii
}
Write-output '
################################################################################################################
### ###
### INFO: INFO FUNCTIONS ###
### ###
################################################################################################################
' | Out-File ./$scriptname -Append -Encoding ascii
Get-ChildItem .\functions\public\info -Recurse -File | ForEach-Object {
Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii
}
Write-output '
################################################################################################################
### ###
### INFO: INSTALL FUNCTIONS ###
### ###
################################################################################################################
' | Out-File ./$scriptname -Append -Encoding ascii
Get-ChildItem .\functions\private\installs -Recurse -File | ForEach-Object {
Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii
}
Get-ChildItem .\functions\public\installs -Recurse -File | ForEach-Object {
Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii
}
Write-output '
################################################################################################################
### ###
### INFO: DEBLOAT FUNCTIONS ###
### ###
################################################################################################################
' | Out-File ./$scriptname -Append -Encoding ascii
Get-ChildItem .\functions\private\debloat -Recurse -File | ForEach-Object {
Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii
}
Get-ChildItem .\functions\public\debloat -Recurse -File | ForEach-Object {
Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii
}
Write-output '
################################################################################################################
### ###
### INFO: OPTIMIZATION FUNCTIONS ###
### ###
################################################################################################################
' | Out-File ./$scriptname -Append -Encoding ascii
Get-ChildItem .\functions\private\optimization -Recurse -File | ForEach-Object {
Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii
}
Get-ChildItem .\functions\public\optimization -Recurse -File | ForEach-Object {
Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii
}
Write-output '
################################################################################################################
### ###
### INFO: SERVICE FUNCTIONS ###
### ###
################################################################################################################
' | Out-File ./$scriptname -Append -Encoding ascii
Get-ChildItem .\functions\public\services -Recurse -File | ForEach-Object {
Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii
}
Write-output '
################################################################################################################
### ###
### INFO: UPDATES FUNCTIONS ###
### ###
################################################################################################################
' | Out-File ./$scriptname -Append -Encoding ascii
Get-ChildItem .\functions\public\updates -Recurse -File | ForEach-Object {
Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii
}
Write-output '
################################################################################################################
### ###
### INFO: CONFIG FUNCTIONS ###
### ###
################################################################################################################
' | Out-File ./$scriptname -Append -Encoding ascii
Get-ChildItem .\functions\private\config -Recurse -File | ForEach-Object {
Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii
}
Get-ChildItem .\functions\public\config -Recurse -File | ForEach-Object {
Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii
}
Write-output '
################################################################################################################
### ###
### INFO: SETUP BACKGROUND CONFIG ###
### ###
################################################################################################################
' | Out-File ./$scriptname -Append -Encoding ascii
Get-Content .\scripts\closure.ps1 | Out-File ./$scriptname -Append -Encoding ascii