Skip to content

Format data for BasicHtmlWebResponseObject contains ParsedHtml and Forms properties #5373

@markekraus

Description

@markekraus

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

Steps to reproduce

$result = iwr 'https://www.bing.com/'
$result

Expected 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

Metadata

Metadata

Assignees

Labels

Issue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions