How to parse html in Powershell Core


So, Invoke-WebRequest in Powershell Core is permanently baked with -UseBasicParsing. More details can be found here and here.

Net result – no ParsedHtml property on the result object.

While the rationale makes perfect sense, the question is – how to parse HTML in Powershell Core?

Now, I can probably use a .NET Core library, like HtmlAgilityPack, but it seems like vast code changes would be required to migrate existing PS code to use this library.

Is this our best option or are there any better ones for PS Core users?


The answer seems to be found here – Unable to use IHTMLDocument2


Probably the easiest way is to use powerHTML module which basically provides a wrapper for HTML Agility Pack



How to parse html in Powershell Core by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply