PowerHTML
PowerHTML copied to clipboard
Update HtmlAgilityPack, Pester Tests, refactor
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
}