-
-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathcreateHTML.ps1
More file actions
37 lines (29 loc) · 1.24 KB
/
createHTML.ps1
File metadata and controls
37 lines (29 loc) · 1.24 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
$TimeNow = Get-Date
$d = $TimeNow.ToUniversalTime()
$version=$d.ToString("yyyyMMddHHmm")
$version= '?v='+ $version
$folder= ".\TestBlocklyHtml\wwwroot\"
$file = Join-Path -Path $folder -ChildPath "blockly.html"
$fileContent = Get-Content $file
$fileContent = $fileContent.Replace('<!--doNotCopyToFinal-->','<!--')
$fileContent = $fileContent.Replace('<!--enddoNotCopyToFinal-->','-->')
$fileContent = $fileContent.Replace('/*doNotCopyToFinal*/','/*')
$fileContent = $fileContent.Replace('/*enddoNotCopyToFinal*/','*/')
$fileContent = $fileContent.Replace('?v=version',$version)
Out-File -InputObject $fileContent -FilePath ".\TestBlocklyHtml\wwwroot\blockly.html"
$zipFile = "$folder\blocklyNetCore.zip"
$compress = @{
Path = "$Folder"
CompressionLevel = "Fastest"
DestinationPath = $zipFile
}
Compress-Archive @compress
$dest ="NetCore2Blockly\blocklyFiles\"
Write-Host ( Get-ChildItem $dest -Recurse | Measure-Object ).Count;
$folder =$folder + "*"
Copy-Item -Path $folder -Destination $dest -Recurse
Write-Host ( Get-ChildItem $dest -Recurse | Measure-Object ).Count;
$indexFile = Join-Path -Path $dest -ChildPath "index.html"
Remove-Item -Path $indexFile
Write-Host ( Get-ChildItem $dest -Recurse | Measure-Object ).Count;
Write-Host "done====="