forked from gibaBR/Switch-Backup-Manager
-
Notifications
You must be signed in to change notification settings - Fork 1
/
transform.ps1
30 lines (28 loc) · 977 Bytes
/
transform.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
param (
[string]$openResult = "n"
)
try
{
write-output $openResult
$XsltSettings = New-Object System.Xml.Xsl.XsltSettings($true, $false);
$XslPath = New-Object System.Xml.Xsl.XslCompiledTransform
$XslPath.Load("allgames.xslt",$XsltSettings, $null)
$XslPath.Transform("nswdb.xml", "allgames.xml")
$XslPath = New-Object System.Xml.Xsl.XslCompiledTransform
$XslPath.Load("missinggames.xslt",$XsltSettings, $null)
$XslPath.Transform("nswdb.xml", "missinggames.xml")
$XslPath = New-Object System.Xml.Xsl.XslCompiledTransform
$XslPath.Load("games.xslt")
$XslPath.Transform("SBM_Local.xml", "SBM_Local.html")
$XslPath.Transform("SBM_NSP_Local.xml", "SBM_NSP_Local.html")
$XslPath.Transform("missinggames.xml", "missing.html")
$XslPath.Transform("allgames.xml", "allgames.html")
Write-Host "Done !"
if ($openResult -eq "y") {
./index.html
}
}
catch
{
Write-Host $_.Exception -ForegroundColor Red
}