PowerHTML icon indicating copy to clipboard operation
PowerHTML copied to clipboard

Update HtmlAgilityPack, Pester Tests, refactor

Open trackd opened this issue 10 months ago • 0 comments

changes

  • Update HtmlAgilityPack to 1.11.60 (this should probably be automated in the build)
  • Update Pester tests to v5 syntax
  • fixes #10, #8
  • refactor ConvertFrom-Html
    • added [OutputType()] for intellisense/completion
    • added 'Position = 0' to all input params so it can bind on type
    • re-use htmlagilitypack.htmldocument/htmlweb instance
    • cleanup
    • simplified

this would also simplify if you wanted to add a param for special cases like, in #7

$html = [HtmlAgilityPack.HtmlDocument]@{
	OptionOutputAsXml           = $true
	OptionReadEncoding          = $true
	OptionDefaultStreamEncoding = [System.Text.Encoding]::UTF8
	OptionAutoCloseOnEnd        = $true
	OptionFixNestedTags         = $true
}
$web = [HtmlAgilityPack.HtmlWeb]@{
	AutoDetectEncoding = $false
	OverrideEncoding   = [System.Text.Encoding]::UTF8
}

trackd avatar Mar 29 '24 02:03 trackd