-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCompile.ps1
33 lines (24 loc) · 1.55 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
$OFS = "`r`n"
$scriptname = "winutil_cli.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\header.ps1).replace('#{replaceme_datetime}', "$(get-date -format yy.MM.dd)") | Out-File ./$scriptname -Append -Encoding ascii
Get-ChildItem .\modules -Recurse -File | ForEach-Object {
Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii
}
Get-ChildItem .\scripts -Recurse -File -Exclude footer.ps1,header.ps1 | ForEach-Object {
Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii
}
Get-ChildItem .\json | Where-Object { $psitem.extension -eq ".json" } | ForEach-Object {
$json = (Get-Content $psitem.FullName).replace("'", "''")
Write-output "`$$($psitem.BaseName.replace('.','')) = '$json'" | Out-File ./$scriptname -Append -Encoding ascii
}
Get-Content .\scripts\footer.ps1 | Out-File ./$scriptname -Append -Encoding ascii