Applying an Xsl transform in PowerShell

I recently worked on a project that required an Xsl stylesheet be applied to an encoded Xml data set. I wanted to avoid the use of external files or executables and was able to leverage the dotnet XmlWriter and XslCompiledTransform classes to accomplish this task. The runbook accepts two parameters, $Xml an Xml object containing…