0

similar to the question XmlException: The input document has exceeded a limit set by MaxCharactersFromEntities, i get an error processing a XML file in Powershell using Select-XML.

The exception is System.Xml.XmlException: The input document has exceeded a limit set by MaxCharactersFromEntities..

So the solution for the C# question is to set the option MaxCharactersFromEntities, but there is no similar parameter in Powershell.

Thanks Steffen

abbgrade
  • 548
  • 5
  • 19

1 Answers1

0

One solution is not to use Select-Xml and to disable the XmlResolver:

param (
    [string] $Path,
    [string] $XPath
)

$xmlFile = New-Object System.Xml.XmlDocument
$xmlFile.XmlResolver = $null
$xmlFile.Load($Path)

Select-Xml -Xml $xmlFile -XPath $XPath
abbgrade
  • 548
  • 5
  • 19