Skip to content

Instantly share code, notes, and snippets.

@bradymholt
Created March 6, 2015 01:45
Show Gist options
  • Select an option

  • Save bradymholt/8e4402cddf0c50e4a3d5 to your computer and use it in GitHub Desktop.

Select an option

Save bradymholt/8e4402cddf0c50e4a3d5 to your computer and use it in GitHub Desktop.
Applies XSLT to XML and outputs HTML
param ($xml, $xsl, $output)
if (-not $xml -or -not $xsl -or -not $output)
{
Write-Host "& .\xslt.ps1 [-xml] xml-input [-xsl] xsl-input [-output] transform-output"
exit;
}
trap [Exception]
{
Write-Host $_.Exception;
}
$xslt = New-Object System.Xml.Xsl.XslCompiledTransform;
$xslt.Load($xsl);
$xslt.Transform($xml, $output);
Write-Host "generated" $output;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment