-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
PowerShell Core (currently) only supports basic parsing on Web Cmdlets. All of the code which contains the actual Forms and ParsedHtmlproperties are behind #if !CORECLR so these properties do not exist on any of the core types. However, The Forms and ParsedHtml properties are defined in the format data.
I believe the decision was that HTML processing would no longer be handled by the WebResponseObject and instead would be part of a separate cmdlet.
Over the course of the past few months have fielded a lot of confused questions about this. I think it would help clarify that this is not supported in Core if the formatting data was updated to match object and remove the dummy Forms and ParsedHtml properties it adds.
Offending code
Line 1263 in fe3e44f
| .AddItemProperty(@"Forms") |
Line 1268 in fe3e44f
| .AddItemProperty(@"ParsedHtml") |
Steps to reproduce
$result = iwr 'https://www.bing.com/'
$resultExpected behavior
Forms and ParsedHtml should not be shown
StatusCode : 200
StatusDescription : OK
Content : <!DOCTYPE html PUBLIC #snip
RawContent : HTTP/1.1 200 OK #snip
Headers : {[Cache-Control, System.String[]], #snip
Images : {@{outerHTML=<img id= #snip
InputFields : {@{outerHTML=<input clas #snip
RawContentLength : 124089
RelationLink : {}
Actual behavior
Forms and ParsedHtml are shown
StatusCode : 200
StatusDescription : OK
Content : <!DOCTYPE html PUBLIC #snip
RawContent : HTTP/1.1 200 OK #snip
Forms :
Headers : {[Cache-Control, System.String[]], #snip
Images : {@{outerHTML=<img id= #snip
InputFields : {@{outerHTML=<input clas #snip
ParsedHtml :
RawContentLength : 124089
RelationLink : {}
Environment data
Name Value
---- -----
PSVersion 6.0.0-beta.9
PSEdition Core
GitCommitId v6.0.0-beta.9
OS Microsoft Windows 10.0.15063
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0