-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathTestXSLT.ps1
More file actions
22 lines (18 loc) · 1.48 KB
/
TestXSLT.ps1
File metadata and controls
22 lines (18 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function Convert-ReportToHtml {
param(
[string]$ReportPath = "./SchemaCompare/SchemaCompare.xml"
)
Write-Verbose -Verbose "Converting report $reportPath to md"
$xslXml = [xml](gc ".\report-transformToMd.xslt")
$reportXml = [xml](gc $reportPath)
$xslt = New-Object System.Xml.Xsl.XslCompiledTransform
$xslt.Load($xslXml)
$stream = New-Object System.IO.MemoryStream
$xslt.Transform($reportXml, $null, $stream)
$stream.Position = 0
$reader = New-Object System.IO.StreamReader($stream)
$text = $reader.ReadToEnd()
Write-Verbose -Verbose "Writing out transformed report to deploymentReport.md"
sc -Path "SchemaCompare\deploymentReport.md" -Value $text
}
Convert-ReportToHtml