internal/ConvertTo-XmlResponse.ps1
function ConvertTo-XmlResponse { [CmdletBinding()] param( [Parameter(Mandatory = $true)] $inputString ) begin { $i = $inputString.IndexOf("<?xml") if ($i -eq -1) { $i = 0 } } process { $cleaned = $inputString.Substring($i) $xml = [xml]$cleaned } end { $xml } } |